chore(deps): update docker/build-push-action action to v6.11.0 (#50) #151
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 OCI image | |
on: | |
push: | |
jobs: | |
push_to_registry: | |
name: Push image to GitHub registry | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/[email protected] | |
- name: Check if we need to login and if image should be pushed | |
id: push_check | |
run: | | |
if [[ "${{ github.ref }}" == refs/heads/main ]]; then | |
echo "push=true" >> $GITHUB_OUTPUT | |
else | |
echo "push=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Log in to the Container registry | |
if: ${{ steps.push_check.outputs.push }} | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: ${{ steps.push_check.outputs.push }} | |
tags: "ghcr.io/${{ github.repository }}:latest" |