Skip to content

dst-admin-go

dst-admin-go #513

Workflow file for this run

name: dst-admin-go
on:
push:
branches:
- main
paths:
- dst-admin-go/*
- .github/workflows/dst-admin-go.yml
workflow_dispatch:
schedule:
- cron: "0 8 * * *"
env:
BUILD_VERSION: "git"
OPENSSL_VERSION: "3.0.0"
PCRE_VERSION: "8.45"
DOCKER_CLI_EXPERIMENTAL: enabled
REPOSITORY: ${{ github.actor }}/${{ github.workflow }}
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- name: Source checkout
uses: actions/checkout@v3
- name: set Environment
run: echo "NOW=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
- name: Setup QEMU
id: qemu
uses: docker/setup-qemu-action@v2
- name: Setup Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Set Docker metadata
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REPOSITORY }}
labels: |
org.opencontainers.image.version=${{ env.BUILD_VERSION }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.title=${{ env.REPOSITORY }}
- name: GitHub login
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: DockerHub login
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: ${{ github.event_name != 'pull_request' }}
context: ${{ github.workflow }}
file: ${{ github.workflow }}/Dockerfile
platforms: linux/amd64
build-args: BUILD_VERSION
cache-from: type=gha, scope=${{ env.NOW }}
cache-to: type=gha, scope=${{ env.NOW }}, mode=max
labels: ${{ steps.docker_meta.outputs.labels }}
tags: |
docker.io/${{ env.REPOSITORY }}:${{ env.NOW }}
docker.io/${{ env.REPOSITORY }}:latest