Skip to content

create collections.yml if it doesn't exist #2

create collections.yml if it doesn't exist

create collections.yml if it doesn't exist #2

name: Publish Docker container
on:
push:
branches:
- main # or the default branch of your repository
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Get short SHA
id: short-sha
run: echo "::set-output name=sha::$(echo $GITHUB_SHA | cut -c1-6)"
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}/screenconditions:latest
ghcr.io/${{ github.repository }}/screenconditions:${{ steps.short-sha.outputs.sha }}