-
Notifications
You must be signed in to change notification settings - Fork 9
56 lines (48 loc) · 1.84 KB
/
publish-outpost-image.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
# This action pre-builds the dev-base image and pushes it to the GitHub Container Registry (GHCR)
name: Publish outpost image to github container registry
on:
push:
branches: [develop, staging, production]
# multi platform builds are disabled until we upgrade to a newer version of heroku stack
jobs:
push-outpost-image:
runs-on: ubuntu-latest
# strategy:
# matrix:
# platforms: ["linux/amd64"]
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@main
- name: "Login to GitHub Container Registry"
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Set Docker Image Tag
id: vars
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
if [[ "$BRANCH_NAME" == "develop" ]]; then
echo "tag=development" >> $GITHUB_ENV
elif [[ "$BRANCH_NAME" == "staging" ]]; then
echo "tag=staging" >> $GITHUB_ENV
elif [[ "$BRANCH_NAME" == "production" ]]; then
echo "tag=latest" >> $GITHUB_ENV
else
echo "tag=default" >> $GITHUB_ENV
fi
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
- name: Build and push outpost docker image
uses: docker/build-push-action@v5
with:
context: .
tags: ghcr.io/wearefuturegov/outpost:${{ env.tag }}
file: Dockerfile.production
# platforms: ${{ matrix.platforms }}
push: true
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Outpost image
labels: org.opencontainers.image.source=https://github.com/wearefuturegov/outpost