mirror of
https://github.com/shiroyashik/doggy-watch.git
synced 2025-12-06 12:31:13 +03:00
This commit is contained in:
parent
5bcfff99a1
commit
591020f04b
11 changed files with 89 additions and 1 deletions
42
.github/workflows/docker-push.yml
vendored
Normal file
42
.github/workflows/docker-push.yml
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
name: Docker Push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# - name: Checkout code
|
||||
# uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# - name: Login to Docker Hub
|
||||
# uses: docker/login-action@v3
|
||||
# with:
|
||||
# username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Get short SHA
|
||||
id: short_sha
|
||||
run: echo "sha=$(echo ${GITHUB_SHA} | cut -c1-7)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
# context: .
|
||||
tags: ghcr.io/${{ github.repository_owner }}/doggy-watch:${{ steps.short_sha.outputs.sha }},ghcr.io/${{ github.repository_owner }}/doggy-watch:latest
|
||||
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/doggy-watch:buildcache
|
||||
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/doggy-watch:buildcache,mode=max
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue