-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (37 loc) · 1006 Bytes
/
release.yml
File metadata and controls
43 lines (37 loc) · 1006 Bytes
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
name: Release
on:
push:
branches:
- "master"
tags:
- "v*.*.*"
- "v*.*.*-rc*"
jobs:
build:
name: Release
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Docker login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker build and push
run: |
image_name=ghcr.io/joshdk/google-analytics-proxy
image_label="$(git describe --tags)"
docker build \
--build-arg CREATED="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
--build-arg REVISION="$(git rev-parse HEAD)" \
--build-arg VERSION="$image_label" \
--tag "$image_name:$image_label" \
.
docker push "$image_name:$image_label"