diff options
| author | akp <tom@tdpain.net> | 2022-04-14 19:00:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-14 19:00:31 +0100 |
| commit | f91b466cbf885109c94d1d102eb28545042f5b57 (patch) | |
| tree | fbfe82c0651de174a382b5670601e0d0b710b4db /.github | |
| parent | 2bdd6919711b36c073b0152a2b6ce02d641c683a (diff) | |
Create docker-image.yml
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/docker-image.yml | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..2f9bdb0 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,34 @@ +name: Docker Image CI + +on: + release: + types: [published] + +env: + IMAGE_NAME: "ghcr.io/codemicro/walrss" + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Get tag version + id: get_version + run: echo ::set-output name=VERSION::$(echo ${GITHUB_REF/refs\/tags\//} | sed sed "s/^v//") + + - name: Make image tags + id: make_tags + run: echo ::set-output name=LATEST::$IMAGE_NAME:latest name=VERSIONED::$IMAGE_NAME:${{ steps.get_version.outputs.VERSION }} + + - name: Build the Docker image + run: docker build . --file Dockerfile --tag ${{ steps.make_tags.outputs.LATEST }} --tag ${{ steps.make_tags.outputs.VERSIONED }} + + - name: Login to ghcr.io + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io --username codemicro --password-stdin + + - name: Push image + run: docker push --all-tags $IMAGE_NAME |
