chore(pre-commit): autoupdate hooks (#19) #20
This file contains 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: Publish image to GHCR | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build, tag, and push image to GitHub Container Registry | |
uses: docker/build-push-action@v4 | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
build-args: GIT-SHA=${{ github.sha }} | |
cache-from: type=gha,scope=cal-itp | |
cache-to: type=gha,scope=cal-itp,mode=max | |
context: . | |
file: appcontainer/Dockerfile | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository }}:${{ github.ref_name }} | |
ghcr.io/${{ github.repository }}:${{ github.sha }} |