This repository has been archived by the owner on Jun 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (51 loc) · 1.65 KB
/
deploy_docker.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Deploy docker
on:
workflow_dispatch:
push:
branches:
- main
jobs:
create_tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- name: Creating new tag
id: tag
run: |
tag=$(date +"%Y.%m.%d.%H.%M")
echo "tag=$tag" >> $GITHUB_OUTPUT
build_and_push_app:
needs:
- create_tag
environment:
name: DockerHub
runs-on: ubuntu-latest
steps:
- name: Checking out the repository
uses: actions/checkout@v3.5.2
- name: Setting up Quick Emulator (QEMU)
uses: docker/setup-qemu-action@v2.1.0
with:
platforms: linux/arm64,linux/amd64
- name: Setting up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.4.1
- name: Logging in to Docker Hub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Building and pushing container image
uses: docker/build-push-action@v4.0.0
with:
context: services
file: services/steganography.api/Dockerfile
platforms: |
linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/steganography:app.latest,
${{ secrets.DOCKER_HUB_USERNAME }}/steganography:app.${{ needs.create_tag.outputs.tag }}
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/steganography:app.cache
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/steganography:app.cache,mode=max