name: Build and Push Docker Image on: push: branches: - docker_workflow jobs: build: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Login to GitHub Docker Registry uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.DOCKER_TOKEN }} - name: Build and Push Image uses: docker/build-push-action@v2 with: context: . file: ./Dockerfile push: true tags: ghcr.io/${{ github.repository }}/jobspy_api:latest - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token with: tag_name: ${{ github.sha }} release_name: Release ${{ github.sha }} draft: false prerelease: false - name: Attach Docker Image to Release run: | echo "Image ghcr.io/${{ github.repository }}/jobspy_api:latest is available under assets in the release."