Use std::sync::LazyLock
to initialise global commands array to be d…
#10
Workflow file for this run
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: Publish to Github Container Registry | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
env: | |
SQLX_OFFLINE: true | |
jobs: | |
push-to-ghcr: | |
name: Push to Github Container Registry | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
# Break up version into major, minor, and patch | |
- name: Setup | Break up version | |
id: version | |
shell: bash | |
env: | |
VERSION: ${{ github.ref_name }} | |
run: | | |
echo "major=`echo "${VERSION:1}" | cut -d '.' -f 1`" >> $GITHUB_OUTPUT | |
echo "minor=`echo "${VERSION:1}" | cut -d '.' -f 2`" >> $GITHUB_OUTPUT | |
echo "patch=`echo "${VERSION:1}" | cut -d '.' -f 3`" >> $GITHUB_OUTPUT | |
- name: Setup | Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup | QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Setup | Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build & Deploy | Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository }}:v${{ steps.version.outputs.major }} | |
ghcr.io/${{ github.repository }}:v${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }} | |
ghcr.io/${{ github.repository }}:${{ github.ref_name }} | |
ghcr.io/${{ github.repository }}:latest |