workflow: add testing-env image build/publish process (#1780)

* workflow: add testing-env image build/publish process

replacing https://hub.docker.com/r/runatlantis/testing-env

Signed-off-by: Rui Chen <rui@chenrui.dev>

* refresh the testing-env image

* only runs on master branch

Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
rui
2021-08-30 23:41:27 -04:00
committed by GitHub
parent f2ded06e25
commit ffda2909c3
4 changed files with 40 additions and 5 deletions

View File

@@ -4,10 +4,10 @@ jobs:
test:
name: runner / gotest
runs-on: ubuntu-latest
container: ghcr.io/runatlantis/testing-env:805e94e7f648eddb0484e539a7b51410d39529bc
container: ghcr.io/runatlantis/testing-env:2021.08.31
steps:
# user in image needs write access to do anything
- name: setup
run: sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp
- uses: actions/checkout@v2
- run: make test-all
- run: make test-all

35
.github/workflows/testing-env-image.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: testing-env-image
on:
push:
paths:
- ./testing/**
- .github/workflows/testing-env-image.yml
branches:
- "master"
workflow_dispatch:
defaults:
run:
working-directory: testing
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to Packages Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: echo "TODAY=$(date +"%Y.%m.%d")" >> $GITHUB_ENV
- name: build testing-env:${{env.TODAY}} image
run: |
docker build -t ghcr.io/runatlantis/testing-env:${{env.TODAY}} .
- name: publish testing-env:${{env.TODAY}} image
run: |
docker push ghcr.io/runatlantis/testing-env:${{env.TODAY}}
docker tag ghcr.io/runatlantis/testing-env:${{env.TODAY}} ghcr.io/runatlantis/testing-env:latest
docker push ghcr.io/runatlantis/testing-env:latest