chore(deps): Bump golang.org/x/crypto from 0.28.0 to 0.31.0 in the go_modules group #87
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: Docker | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_run: | |
workflows: | |
- "Create Release" | |
types: | |
- completed | |
env: | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: ghcr.io | |
# github.repository as <account>/<repo> | |
IMAGE_NAME: ${{ github.repository }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false | |
jobs: | |
docker-build: | |
name: Build Docker Images | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
cache-dependency-path: "**/*.sum" | |
# Login against a Docker registry except on PR | |
# https://github.com/docker/login-action | |
- name: Log into registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Shorten hash | |
id: shorten_hash | |
run: | | |
if ${{ github.event_name == 'workflow_run' }} && ${{ github.event.workflow_run.conclusion == 'success' }}; then | |
echo "HASH=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | |
else | |
echo "HASH=$(git describe --tags)" >> $GITHUB_ENV | |
fi | |
- name: Lowercase Image Name | |
run: echo "LOWER_IMAGE_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
- name: Build app | |
run: docker build -t ${{ env.REGISTRY }}/${{ env.LOWER_IMAGE_NAME }}:${{ env.HASH }} -t ${{ env.REGISTRY }}/${{ env.LOWER_IMAGE_NAME }}:latest . | |
- name: Push app | |
if: ${{ github.event_name != 'pull_request' }} | |
run: | | |
docker push ${{ env.REGISTRY }}/${{ env.LOWER_IMAGE_NAME }}:${{ env.HASH }} | |
docker push ${{ env.REGISTRY }}/${{ env.LOWER_IMAGE_NAME }}:latest |