mirror of
https://github.com/dmmeteo/docker-shlink-web-client.git
synced 2025-05-01 00:32:45 +01:00
setup build job
This commit is contained in:
parent
90aea066ff
commit
d1026a3eb9
62
.github/workflows/docker.yml
vendored
Normal file
62
.github/workflows/docker.yml
vendored
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
name: Docker build images
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 10 * * 1" # everyday Monday at 10am
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
|
||||||
|
env:
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
main:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 20
|
||||||
|
steps:
|
||||||
|
- name: Check out the repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Set image name based on the repository name
|
||||||
|
id: step_one
|
||||||
|
run: |
|
||||||
|
IMAGE_NAME="${GITHUB_REPOSITORY/docker-/}"
|
||||||
|
echo $IMAGE_NAME
|
||||||
|
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: ${{ env.IMAGE_NAME }}
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
- name: Login to DockerHub
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
- name: Buildx cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{ github.workspace }}/cache
|
||||||
|
key: ${{ runner.os }}-docker-${{ hashFiles('cache/**') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-docker
|
||||||
|
- name: Build and push
|
||||||
|
id: docker_build
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
platforms: ${{ env.platforms }}
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
cache-from: type=local,src=${{ github.workspace }}/cache
|
||||||
|
cache-to: type=local,dest=${{ github.workspace }}/cache
|
Loading…
x
Reference in New Issue
Block a user