-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (40 loc) · 1.44 KB
/
build-deliver.yaml
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
# docker continuous delivery
# deliver docker images to configured repo with tags to match branches and git tags
---
name: Build & Deliver
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout commit with full git history
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set environment variable for version from git output
run: echo "VERSION_STRING=$(git describe --always --tags)" >> $GITHUB_ENV
- name: Publish to GitHub Container Registry
# TODO: pin to hash
uses: elgohr/Publish-Docker-Github-Action@main
with:
name: ${{ github.repository }}
registry: ghcr.io
# GitHub actor
username: ${{ github.actor }}
# GitHub access token
password: ${{ secrets.GITHUB_TOKEN }}
# create docker image tags to match git tags
tag_names: true
buildargs: VERSION_STRING
# TODO remove after every *-environments migrated to GHCR
- name: Publish to Dockerhub registry
# TODO pin to hash
uses: elgohr/Publish-Docker-Github-Action@main
with:
name: ${{ github.repository }}
# configured at repo settings/secrets
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# create docker image tags to match git tags
tag_names: true
buildargs: VERSION_STRING