-
-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (49 loc) · 1.6 KB
/
deploy-staging.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
57
58
---
name: Build & Deploy Staging
on:
push:
branches: [staging]
jobs:
build-docker-images:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [20]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
- name: Set Short SHA variable
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
- name: Get Latest tag
id: latesttag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 'UNKNOWN' # Optional fallback tag to use when no tag can be found
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: latest
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push staging image
uses: docker/build-push-action@v3
with:
file: provisioning/staging/Dockerfile
platforms: linux/amd64
push: true
tags: maelstromeous/ps2alerts:website-staging-${{ github.sha }},maelstromeous/ps2alerts:website-staging-latest
build-args: |
BUILD_SHA=${{ env.SHORT_SHA }}
BUILT=${{ env.NOW }}
VERSION=${{ steps.latesttag.outputs.tag }}