Build/Publish Image #72
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/Publish Image | |
on: | |
push: | |
branches: | |
- "main" | |
schedule: | |
- cron: "0 10 * * SUN" | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
- name: Run Hadolint | |
uses: hadolint/hadolint-action@v3.1.0 | |
get-version: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
needs: lint | |
container: debian:stable-slim | |
outputs: | |
appversion: ${{ steps.get-version.outputs.APPVERSION }} | |
steps: | |
- name: Get version | |
id: get-version | |
run: | | |
apt-get update && apt-get -y --no-install-recommends install ca-certificates curl jq | |
APPVERSION=$(curl -s https://api.github.com/repos/Wind4/vlmcsd/releases/latest | jq -r '.name' | cut -d'-' -f2) | |
echo "APPVERSION=${APPVERSION}" >> $GITHUB_OUTPUT | |
build: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
needs: [lint, get-version] | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Quay.io | |
uses: docker/login-action@v2 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: Metadata | |
id: metadata | |
uses: docker/metadata-action@v4 | |
with: | |
images: quay.io/linutux/vlmcsd | |
flavor: latest=true | |
tags: type=raw,value=${{ needs.get-version.outputs.appversion }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.metadata.outputs.tags }} | |
labels: ${{ steps.metadata.outputs.labels }} |