Skip to content

Update init-db.sh

Update init-db.sh #17

name: Docker
on: [push, pull_request]
jobs:
push:
name: Build and publish Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Repo metadata
id: repo
uses: actions/github-script@v3
with:
script: return (await github.repos.get(context.repo)).data
- uses: Illarion-eV/Illarion-Docker-Version@v1
id: docker-vars
with:
latest-on-branches: main
registry-secret: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: ${{ runner.os }}-buildx-
- name: Login to GitHub
if: ${{ steps.docker-vars.outputs.has-docker-secret == 'true' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ steps.docker-vars.outputs.docker-secret }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: ${{ steps.docker-vars.outputs.has-docker-secret == 'true' }}
tags: ${{ steps.docker-vars.outputs.tags }}
labels: |
org.opencontainers.image.title=${{ fromJson(steps.repo.outputs.result).name }}
org.opencontainers.image.description=${{ fromJson(steps.repo.outputs.result).description }}
org.opencontainers.image.url=${{ fromJson(steps.repo.outputs.result).html_url }}
org.opencontainers.image.source=${{ fromJson(steps.repo.outputs.result).clone_url }}
org.opencontainers.image.version=${{ steps.docker-vars.outputs.version }}
org.opencontainers.image.created=${{ steps.docker-vars.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ fromJson(steps.repo.outputs.result).license.spdx_id }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache