Files
atlantis/.github/workflows/atlantis-base.yml
rui 9fc4f13407 workflow: automate atlantis-base image build (#1648)
* workflow: add atlantis-base image automation

* comment out path trigger

* push to ghcr.io registry

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

* rm ` rm -rf /root/.gnupg`

```
rm: can't remove '/root/.gnupg/S.gpg-agent.extra': No such file or directory

```

* try a different cleanup fix

* use GITHUB_TOKEN for accessing ghcr.io registry

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

* also tag latest image

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

* only runs on master

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

* also can be manually triggered

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

* update date fmt `yyyy.mm.dd` for docker tag
2021-06-22 18:50:48 -04:00

35 lines
973 B
YAML

name: atlantis-base
on:
push:
paths:
- 'docker-base/**'
branches:
- "master"
workflow_dispatch:
defaults:
run:
working-directory: docker-base
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 atlantis-base:${{env.TODAY}} image
run: |
docker build -t ghcr.io/runatlantis/atlantis-base:${{env.TODAY}} .
- name: publish atlantis-base:${{env.TODAY}} image
run: |
docker push ghcr.io/runatlantis/atlantis-base:${{env.TODAY}}
docker tag ghcr.io/runatlantis/atlantis-base:${{env.TODAY}} ghcr.io/runatlantis/atlantis-base:latest
docker push ghcr.io/runatlantis/atlantis-base:latest