ci: add workflow for checking storage (#92) #40
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
name: docker-publish | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# Run this job only on push to master branch | |
if: github.event_name != 'pull_request' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v1 | |
with: | |
install: true | |
driver-opts: >- | |
image=moby/buildkit:master | |
- name: Cache main image layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
# Login against a Docker registry except on PR | |
# https://github.com/docker/login-action | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Build And Push Image | |
- name: Build Docker image | |
run: docker compose -f docker-compose-build.yaml build | |
- name: Push Docker image | |
run: docker compose -f docker-compose-build.yaml push |