-
Notifications
You must be signed in to change notification settings - Fork 18
61 lines (54 loc) · 1.81 KB
/
docker-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: docker-build
on:
schedule:
- cron: "0 10 * * *"
push:
branches:
- main
tags:
- '*'
workflow_dispatch:
inputs:
build_only:
type: boolean
description: 'Only build the image, no push'
required: false
default: false
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for existing website-base image for current branch
if: "${{ !startsWith(github.ref, 'refs/tags/v') }}"
id: existing-image
run: |
if docker pull geokrety/website-base:${{ github.ref_name }}; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Override base image tag from branch name
if: "${{ !startsWith(github.ref, 'refs/tags/v') && steps.existing-image.outputs.exists == 'true' }}"
run: |
sed -i "s/^ARG BASE_TAG=.*$/ARG BASE_TAG=${{ github.ref_name }}/" Dockerfile
- uses: geokrety/geokrety-gha-workflows/.github/actions/docker-build@main
with:
image_name: geokrety/website
dockerhub_username: ${{ vars.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
push: ${{ inputs.build_only == 'false' || true }}
update-version-set:
uses: geokrety/geokrety-gha-workflows/.github/workflows/version-set.yml@main
needs: docker
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
deploy:
uses: geokrety/geokrety-gha-workflows/.github/workflows/trigger-staging-deploy.yml@main
needs: docker
secrets:
DEPLOY_HEADER_NAME: ${{ secrets.DEPLOY_HEADER_NAME }}
DEPLOY_HEADER_VALUE: ${{ secrets.DEPLOY_HEADER_VALUE }}
DEPLOY_URL: ${{ secrets.DEPLOY_URL }}