-
Notifications
You must be signed in to change notification settings - Fork 26
49 lines (42 loc) · 1.57 KB
/
release-runner.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
name: Build and release Runner
on:
release:
types: [created]
jobs:
build_and_release_runner:
if: startsWith(github.ref, 'refs/tags/runner-')
environment: Release
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['py38', 'py39', 'py310', 'py311', 'py312']
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
id: login-ecr
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
with:
mask-password: 'true'
registry-type: public
- name: Extract tag name
run: echo "RUNNER_TAG=${GITHUB_REF#refs/tags/runner-}" >> $GITHUB_ENV
- name: Build and push Docker image for ${{ matrix.python-version }}
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/Dockerfile.runner
push: true
tags: ${{ secrets.ECR_REGISTRY }}/beta9-runner:${{ matrix.python-version }}-${{ env.RUNNER_TAG }},${{ secrets.ECR_REGISTRY }}/beta9-runner:${{ matrix.python-version }}-latest
target: ${{ matrix.python-version }}
load: false
registry: ${{ steps.login-ecr.outputs.registry }}
repository: ${{ steps.login-ecr.outputs.registry }}/beta9-runner
add_git_labels: true
tag_with_ref: true