refactor: linting #2114
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: Build container image | |
on: | |
schedule: | |
- cron: "23 9 * * *" | |
push: | |
branches: [develop] | |
pull_request: | |
branches: [develop] | |
merge_group: | |
jobs: | |
# Push image to GitHub Packages. | |
docker: | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: read | |
packages: write | |
env: | |
# Check if this is not a pull request andGITHUB_TOKEN is set | |
# As all env variables are strings, you need to compare | |
# against "== 'true'" (not "== true") | |
IS_NOT_PR: "${{ !github.head_ref && true }}" | |
steps: | |
- name: Checkout Sample-Server | |
uses: actions/checkout@v4.2.2 | |
with: | |
path: Sample-Server | |
submodules: recursive | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3.3.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3.8.0 | |
- name: PrepareReg Names | |
run: | | |
echo IMAGE_REPOSITORY="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" | |
echo IMAGE_TAG="$(echo "${{ github.ref }}" | tr '[:upper:]' '[:lower:]' | awk '{sub(/([^\/]*\/){2}/,""); gsub(/\/|_/, "-")}1')" >> "$GITHUB_ENV" | |
echo IS_NOT_PR="${{ env.IS_NOT_PR }})" | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3.3.0 | |
if: github.event_name != 'pull_request' | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Extract metadata (tags, labels) for Docker | |
# https://github.com/docker/metadata-action | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5.6.1 | |
with: | |
images: ghcr.io/${{ env.IMAGE_REPOSITORY }} | |
- name: Build Docker Release | |
uses: "docker/build-push-action@v6.13.0" | |
with: | |
provenance: false | |
file: "./Sample-Server/Dockerfile" | |
context: ./Sample-Server | |
platforms: linux/amd64, linux/arm64, linux/arm/v7 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
ghcr.io/${{ env.IMAGE_REPOSITORY }}:${{ env.IMAGE_TAG }} |