This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
Merge pull request #60 from esune/chore/update-readme #6
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: Build and Push Docker Image | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get short SHA | |
id: vars | |
run: echo "::set-output name=sha_short::$(echo $GITHUB_SHA | cut -c1-7)" | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: docker/dav-controller/Dockerfile | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository }}/dav-controller:latest | |
ghcr.io/${{ github.repository }}/dav-controller:${{ steps.vars.outputs.sha_short }} |