butler-sheet-icons: v3.6.0 #6
Workflow file for this run
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
# Inspiration | |
# https://github.com/actions/starter-workflows/blob/main/ci/docker-publish.yml | |
name: build-docker-image | |
on: | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
# - name: Send job status to MQTT (starting job) | |
# uses: potaesm/github-actions-mqtt-request@1.0.0 | |
# if: always() | |
# env: | |
# JOB_CONCLUSION: ${{ job.status }} | |
# NODE_VERSION: ${{ matrix.node }} | |
# with: | |
# url: ${{ secrets.PUBLIC_MQTT_BROKER_URL }} | |
# topic: control/github_actions_action_runner | |
# payload: '{ "type":"ci-test", "repo": "${{ github.repository }}", "job": "${{ github.job }}", "workflow": "${{ github.workflow }}", "nodeVersion": "${{ env.NODE_VERSION }}","status": "in_progress","conclusion":"${{ env.JOB_CONCLUSION }}" }' | |
# username: ${{ secrets.PUBLIC_MQTT_BROKER_USER }} | |
# connectTimeout: 30000 | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
if: | | |
github.event_name != 'pull_request' && | |
github.repository_owner == 'ptarmiganlabs' | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
if: | | |
github.event_name != 'pull_request' && | |
github.repository_owner == 'ptarmiganlabs' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
if: | | |
github.event_name != 'pull_request' && | |
github.repository_owner == 'ptarmiganlabs' | |
# Login against a Docker registry except on PR | |
# https://github.com/marketplace/actions/docker-login | |
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
if: | | |
github.event_name != 'pull_request' && | |
github.repository_owner == 'ptarmiganlabs' | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Create clean tag for Docker | |
run: | | |
export TAGTMP1=${{ github.ref }} | |
echo "TAG=$(echo "${TAGTMP1##*-}")" >> $GITHUB_ENV | |
- name: Dump GitHub context | |
if: always() | |
env: | |
GITHUB_CONTEXT: ${{ toJSON(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- name: Dump job context | |
if: always() | |
env: | |
JOB_CONTEXT: ${{ toJSON(job) }} | |
run: echo "$JOB_CONTEXT" | |
- name: Dump steps context | |
if: always() | |
env: | |
STEPS_CONTEXT: ${{ toJSON(steps) }} | |
run: echo "$STEPS_CONTEXT" | |
- name: Dump runner context | |
if: always() | |
env: | |
RUNNER_CONTEXT: ${{ toJSON(runner) }} | |
run: echo "$RUNNER_CONTEXT" | |
- name: Dump strategy context | |
if: always() | |
env: | |
STRATEGY_CONTEXT: ${{ toJSON(strategy) }} | |
run: echo "$STRATEGY_CONTEXT" | |
# Extract metadata (tags, labels) for Docker | |
# https://github.com/marketplace/actions/docker-metadata-action | |
- name: Extract Docker metadata | |
id: meta | |
if: | | |
github.event_name != 'pull_request' && | |
github.repository_owner == 'ptarmiganlabs' | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ github.repository }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}},value=${{ env.TAG }} | |
type=semver,pattern={{major}}.{{minor}},value=${{ env.TAG }} | |
type=semver,pattern={{major}},value=${{ env.TAG }} | |
- name: Show Docker tags that will be used | |
if: | | |
github.event_name != 'pull_request' && | |
github.repository_owner == 'ptarmiganlabs' | |
run: echo '${{ steps.meta.outputs.tags }}' | |
- name: Show Docker labels that will be used | |
if: | | |
github.event_name != 'pull_request' && | |
github.repository_owner == 'ptarmiganlabs' | |
run: echo '${{ steps.meta.outputs.labels }}' | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v5 | |
if: | | |
github.event_name != 'pull_request' && | |
github.repository_owner == 'ptarmiganlabs' | |
with: | |
context: ./src | |
platforms: | | |
linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Image digest | |
if: | | |
github.event_name != 'pull_request' && | |
github.repository_owner == 'ptarmiganlabs' | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
# - name: Send job status to MQTT when done | |
# uses: potaesm/github-actions-mqtt-request@1.0.0 | |
# if: always() | |
# env: | |
# JOB_STATUS: ${{ job.status }} | |
# with: | |
# url: ${{ secrets.PUBLIC_MQTT_BROKER_URL }} | |
# topic: control/github_actions_action_runner | |
# payload: '{ "type":"docker-build", "repo": "${{ github.repository }}", "job": "${{ github.job }}", "workflow": "${{ github.workflow }}","status": "completed","conclusion":"${{ env.JOB_STATUS }}" }' | |
# username: ${{ secrets.PUBLIC_MQTT_BROKER_USER }} | |
# connectTimeout: 30000 |