Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
chore(template): sync with ahmadnassri/template-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Oct 5, 2021
1 parent e96b125 commit 3bfea46
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 1 deletion.
139 changes: 139 additions & 0 deletions .github/workflows/push.yml
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 }}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.8'
services:
# ---- super-linter ---- #
lint:
image: github/super-linter:v3
image: github/super-linter:v4
volumes:
- ./:/tmp/lint
environment:
Expand Down

0 comments on commit 3bfea46

Please sign in to comment.