Skip to content

Commit

Permalink
ci: add docker image auto delivery
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaGiulianelli committed Jan 16, 2023
1 parent 2a36c9f commit 05f996d
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,40 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Generate Documentation
run: ./gradlew dokkaHtml
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install
npx semantic-release
docker-image-delivery:
needs:
- release
runs-on: ubuntu-latest
if: needs.release.outputs.release-status == released
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Login to GitHub Container registry
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: version
run: echo "version=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
- name: Build and push the image to GitHub Container registry
uses: docker/build-push-action@3.3.0
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
documentation-deploy:
needs:
- release
Expand Down Expand Up @@ -106,6 +132,8 @@ jobs:
needs:
- build
- release
- docker-image-delivery
- documentation-deploy
if: >-
always() && (
contains(join(needs.*.result, ','), 'failure')
Expand Down

0 comments on commit 05f996d

Please sign in to comment.