Skip to content

code style linter, used clojure-lsp #534

code style linter, used clojure-lsp

code style linter, used clojure-lsp #534

Workflow file for this run

name: docker
on:
pull_request:
push:
branches:
- main
tags:
- v*
permissions:
contents: write
packages: write
jobs:
release:
runs-on: "ubuntu-20.04"
environment: release
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4.0.2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ghcr.io/moclojer/moclojer:dev,ghcr.io/moclojer/moclojer:latest
# from here down is executed in the `main` branch
- name: ghcr.io login
if: github.ref_name == 'main' || startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.RELEASE_TOKEN }}
- name: ghcr.io push moclojer:dev @ branch main
if: github.ref_name == 'main'
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=local,src=/tmp/.buildx-cache
push: true
tags: ghcr.io/moclojer/moclojer:dev
# for relase (prefix `v*`)
- name: set env release name
if: startsWith(github.event.ref, 'refs/tags/v')
run: echo "RELEASE_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: ghcr.io push by git tag
if: startsWith(github.event.ref, 'refs/tags/v')
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=local,src=/tmp/.buildx-cache
push: true
tags: ghcr.io/moclojer/moclojer:latest,ghcr.io/moclojer/moclojer:${{ env.RELEASE_NAME }}
secrets: |
GIT_AUTH_TOKEN=${{ secrets.RELEASE_TOKEN }}