deploy docker image workflow

This commit is contained in:
selim13
2021-08-25 13:42:27 +03:00
parent 1cdd36b627
commit 5ba9157845
4 changed files with 56 additions and 0 deletions

2
.actrc Normal file
View File

@@ -0,0 +1,2 @@
-P ubuntu-latest=catthehacker/ubuntu:act-latest
--secret-file .secrets

2
.dockerignore Normal file
View File

@@ -0,0 +1,2 @@
.secrets
.act

View File

@@ -0,0 +1,51 @@
name: Deploy docker image
on:
push:
branches:
- "master"
tags:
- "*"
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
${{ secrets.DOCKERHUB_REPOSITORY }}
ghcr.io/${{ github.repository }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.secrets