-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (73 loc) · 2.46 KB
/
test-container.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
name: Deploy Test Containers
on:
push:
branches: [main]
paths:
- itest/container/*
- .github/workflows/test-container.yml
pull_request:
branches: [main]
paths:
- itest/container/*
- .github/workflows/test-container.yml
workflow_dispatch:
env:
REGISTRY: ghcr.io
permissions:
contents: read
jobs:
push_to_registry:
name: Deploy Docker Image - Test
runs-on: ubuntu-latest
permissions:
packages: write
deployments: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.dockerfile }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
config:
- dockerfile: itest/container/Dockerfile
context: itest/container
tag: integration
deployment-environment-identifier: Integration Container
timeout-minutes: 60
steps:
- name: Repository checkout
uses: actions/checkout@v4
- name: Set up Docker
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
name: Start deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{ matrix.config.deployment-environment-identifier }}
- name: Build and Push Container
uses: docker/build-push-action@v6
with:
file: ${{ matrix.config.dockerfile }}
context: ${{ matrix.config.context }}
tags: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.config.tag }}:latest
push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
- if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
name: Update deployment status
uses: bobheadxi/deployments@v1
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env: ${{ steps.deployment.outputs.env }}
env_url: https://github.com/${{ github.repository }}/releases/tag/${{ env.RELEASE_VERSION }}