forked from runatlantis/atlantis
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.59 KB
/
atlantis-image.yml
File metadata and controls
52 lines (48 loc) · 1.59 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
name: atlantis-image
on:
push:
branches:
- "master"
release:
types:
- "published"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Login to Packages Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Publish dev image to container registry
- name: build atlantis:dev image
if: ${{ github.event_name == 'push'}}
run: |
make build-service
docker build -t ghcr.io/runatlantis/atlantis:dev .
- name: publish atlantis:dev image
if: ${{ github.event_name == 'push'}}
run: |
docker push ghcr.io/runatlantis/atlantis:dev
# Publish release to container registry
- name: populate release version
if: ${{ github.event_name == 'release'}}
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: build atlantis:$RELEASE_VERSION release image
if: ${{ github.event_name == 'release'}}
run: |
make build-service
docker build -t ghcr.io/runatlantis/atlantis:$RELEASE_VERSION .
- name: publish atlantis:$RELEASE_VERSION release image
if: ${{ github.event_name == 'release'}}
run: |
docker push ghcr.io/runatlantis/atlantis:$RELEASE_VERSION
docker tag ghcr.io/runatlantis/atlantis:$RELEASE_VERSION ghcr.io/runatlantis/atlantis:latest
docker push ghcr.io/runatlantis/atlantis:latest