-
-
Notifications
You must be signed in to change notification settings - Fork 4
81 lines (78 loc) · 2.55 KB
/
ci.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
name: ci
concurrency: ci
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.3.0
- name: Build and push Docker image
uses: docker/build-push-action@v5.3.0
with:
context: .
load: true
tags: tenjaa/concourse-github-app-token:${{ github.sha }}
- name: Save image
run: |
docker save tenjaa/concourse-github-app-token:${{ github.sha }} > concourse-github-app-token.tar
- name: Pass image to next job
uses: actions/upload-artifact@v4.3.1
with:
name: image
path: concourse-github-app-token.tar
e2e:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.3
- uses: actions/download-artifact@v4.1.6
with:
name: image
- run: |
docker load < concourse-github-app-token.tar
- name: test
run: ./e2e.sh
env:
APP_ID: ${{ secrets.app_id }}
INSTALLATION_ID: ${{ secrets.installation_id }}
PRIVATE_KEY: ${{ secrets.private_key }}
release:
needs: [e2e]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4.1.6
with:
name: image
- run: |
docker load < concourse-github-app-token.tar
- uses: docker/login-action@v3.1.0
with:
username: tenjaa
password: ${{ secrets.docker_password }}
- name: Login to Public ECR
uses: docker/login-action@v3.1.0
with:
registry: public.ecr.aws
username: ${{ secrets.ECR_ACCESS_KEY_ID }}
password: ${{ secrets.ECR_SECRET_ACCESS_KEY }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Update latest tag
run: |
docker tag tenjaa/concourse-github-app-token:${GITHUB_SHA} tenjaa/concourse-github-app-token:latest
docker tag tenjaa/concourse-github-app-token:${GITHUB_SHA} public.ecr.aws/f1s7y4s6/concourse-github-app-token:latest
docker tag tenjaa/concourse-github-app-token:${GITHUB_SHA} ghcr.io/tenjaa/concourse-github-app-token:latest
docker push tenjaa/concourse-github-app-token:latest
docker push public.ecr.aws/f1s7y4s6/concourse-github-app-token:latest
docker push ghcr.io/tenjaa/concourse-github-app-token:latest