Bump julia-actions/cache from 2 to 3 #100
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Push Docker image to GHCR | |
| env: | |
| IMAGE_NAME: onlinenmfjl | |
| repo-name: kokitsuyuzaki/OnlineNMF.jl | |
| permissions: | |
| contents: read | |
| packages: write | |
| on: [push, pull_request] | |
| jobs: | |
| build_push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v6 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Declare some variables | |
| id: vars | |
| shell: bash | |
| run: | | |
| echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | |
| - name: Build | |
| run: docker build -t ${{ github.repository_owner }}/${{ env.IMAGE_NAME }} . | |
| - name: Tag (Latest) | |
| run: docker tag ${{ github.repository_owner }}/${{ env.IMAGE_NAME }} ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | |
| - name: Tag (SHA) | |
| run: docker tag ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.sha_short }} | |
| - name: Push (Latest) | |
| run: docker push ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest | |
| - name: Push (SHA) | |
| run: docker push ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.sha_short }} | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.sha_short }} |