-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (43 loc) · 1.24 KB
/
main.yml
File metadata and controls
53 lines (43 loc) · 1.24 KB
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
name: Build
on: [pull_request]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run commitlint
uses: wagoid/commitlint-github-action@v4
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.42.0
docker:
name: Docker
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- 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="pr$(echo "$GITHUB_REF" | cut -d/ -f3)"
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"