Skip to content

upgrading all Actions steps #8

upgrading all Actions steps

upgrading all Actions steps #8

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
paths:
- 'Dockerfile'
- 'requirements.txt'
- '.github/workflows/docker-image.yml'
pull_request:
branches: [ "main" ]
paths:
- 'Dockerfile'
- 'requirements.txt'
- '.github/workflows/docker-image.yml'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push docker image
id: docker_build
uses: docker/build-push-action@v4
with:
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/animate:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache