This repository has been archived by the owner on Sep 13, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(template): sync with ahmadnassri/template-docker
- Loading branch information
Ahmad Nassri
committed
Oct 5, 2021
1 parent
e96b125
commit 3bfea46
Showing
2 changed files
with
140 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
on: push | ||
|
||
name: push | ||
|
||
jobs: | ||
commit-lint: | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: ahmadnassri/action-commit-lint@v1 | ||
with: | ||
config: .github/linters/.commit-lint.yml | ||
|
||
super-linter: | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: github/super-linter@v4.8.1 | ||
env: | ||
LOG_LEVEL: ERROR | ||
VALIDATE_ALL_CODEBASE: false | ||
FILTER_REGEX_EXCLUDE: '/github/workspace/README.md|test/fixtures/*' | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
release: | ||
timeout-minutes: 5 | ||
|
||
needs: | ||
- commit-lint | ||
- super-linter | ||
|
||
# only runs on main branch | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
published: ${{ steps.release.outputs.published }} | ||
release-version: ${{ steps.release.outputs.release-version }} | ||
release-version-major: ${{ steps.release.outputs.release-version-major }} | ||
release-version-minor: ${{ steps.release.outputs.release-version-minor }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: release | ||
uses: ahmadnassri/action-semantic-release@v1 | ||
with: | ||
config: ${{ github.workspace }}/.semantic.json | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
|
||
publish: | ||
timeout-minutes: 10 | ||
|
||
needs: | ||
- release | ||
|
||
if: ${{ needs.release.outputs.published == 'true' }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2.1.4 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: buildx-${{ github.sha }} | ||
restore-keys: buildx- | ||
|
||
- uses: docker/setup-qemu-action@v1 | ||
- uses: docker/setup-buildx-action@v1 | ||
|
||
# login to docker hub | ||
- uses: docker/login-action@v1 | ||
with: | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
|
||
# login to github container registry | ||
- uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GH_TOKEN }} | ||
|
||
- id: hub | ||
run: echo "::set-output name=name::$(basename "${GITHUB_REPOSITORY/docker-//}")" | ||
|
||
# publish | ||
- uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
tags: | | ||
${{ github.repository_owner }}/${{ steps.hub.outputs.name }}:latest | ||
${{ github.repository_owner }}/${{ steps.hub.outputs.name }}:${{ needs.release.outputs.release-version-major }} | ||
${{ github.repository_owner }}/${{ steps.hub.outputs.name }}:${{ needs.release.outputs.release-version }} | ||
ghcr.io/${{ github.repository_owner }}/${{ steps.hub.outputs.name }}:latest | ||
ghcr.io/${{ github.repository_owner }}/${{ steps.hub.outputs.name }}:${{ needs.release.outputs.release-version-major }} | ||
ghcr.io/${{ github.repository_owner }}/${{ steps.hub.outputs.name }}:${{ needs.release.outputs.release-version }} | ||
labels: | | ||
org.opencontainers.image.title=${{ steps.hub.outputs.name }} | ||
org.opencontainers.image.url=${{ github.event.repository.html_url }} | ||
org.opencontainers.image.version=${{ needs.release.outputs.release-version }} | ||
org.opencontainers.image.source=${{ github.event.repository.clone_url }} | ||
org.opencontainers.image.revision=${{ github.sha }} | ||
template-sync: | ||
timeout-minutes: 20 | ||
|
||
needs: | ||
- release | ||
- commit-lint | ||
- super-linter | ||
|
||
# only runs on main branch | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: ahmadnassri/action-workflow-queue@v1.1 | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- uses: ahmadnassri/action-template-repository-sync@v1.6.0 | ||
with: | ||
github-token: ${{ secrets.GH_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters