-
Notifications
You must be signed in to change notification settings - Fork 313
44 lines (41 loc) · 1.42 KB
/
gate.yaml
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
# Run integration tests when a PR is merged to master and publish a
# docker container (with an `edge` tag) with the latest code
name: gate
on:
workflow_run:
workflows:
- check
types:
- completed
branches:
- master
jobs:
integration-tests:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: "./.github/workflows/integration-tests.yaml"
with:
# role generated from https://github.com/Sceptre/sceptre-aws/blob/master/config/prod/gh-oidc-sceptre-tests.yaml
role-to-assume: "arn:aws:iam::743644221192:role/gh-oidc-sceptre-tests"
docker-build-push:
needs:
- integration-tests
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
# docker convention: edge tag refers to the very latest code
- name: Build and push Docker image to sceptreorg/sceptre:${{ steps.meta.outputs.tags }}
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: sceptreorg/sceptre:edge
labels: ${{ steps.meta.outputs.labels }}