Skip to content

Commit

Permalink
chore(ci): refactored workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
visibilityspots committed Nov 7, 2024
1 parent 7ef5855 commit a859394
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker-hub-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: docker-hub-description

on:
push:
tags:
- '*'
workflow_call:
secrets:
DOCKERHUB_TOKEN:
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
env:
DOCKERHUB_USERNAME: ${{ vars.DOCKERHUB_USERNAME }}
DOCKERHUB_REPOSITORY: ${{ vars.DOCKERHUB_REPOSITORY }}
GOSS_CMD: ''

jobs:
test:
Expand All @@ -23,15 +24,14 @@ jobs:
- name: Build Docker image
run: docker build -t ${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPOSITORY }}:dev .

- name: Install Goss
uses: e1himself/goss-installation-action@v1.2.1
- uses: e1himself/goss-installation-action@v1.2.1
with:
version: 'v0.4.9'

- name: Execute Goss tests
- name: Execute Goss
env:
GOSS_FILES_STRATEGY: cp
run: dgoss run ${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPOSITORY }}:dev
run: dgoss run ${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPOSITORY }}:dev ${{ env.GOSS_CMD }}

deploy:
needs: test
Expand All @@ -50,7 +50,8 @@ jobs:

- uses: docker/setup-buildx-action@v3

- uses: docker/build-push-action@v6
- name: Build and push ${{ env.DOCKERHUB_REPOSITORY }} image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
Expand All @@ -62,19 +63,23 @@ jobs:
cache-from: type=registry,ref=${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPOSITORY }}:buildcache
cache-to: type=registry,ref=${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPOSITORY }}:buildcache,mode=max

- uses: requarks/changelog-action@v1
- name: Generate CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}

- uses: ncipollo/release-action@v1
- name: Create github ${{ github.ref_name }} release
uses: ncipollo/release-action@v1
with:
makeLatest: true
allowUpdates: true
body: ${{ steps.changelog.output.changes }}
token: ${{ github.token }}

- uses: stefanzweifel/git-auto-commit-action@v5
- name: Commit updated CHANGELOG.md for ${{ github.ref_name }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: trivy

on:
push:
tags:
- '*'
schedule:
- cron: '44 19 * * 4'
workflow_call:
Expand Down

0 comments on commit a859394

Please sign in to comment.