-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.48 KB
/
deploy_image.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
name: Build and Push Docker Image
on:
push:
jobs:
build-and-push-image:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: |
zarathucorp/devenv-docker
- name: Set TAG env
run: echo "RELEASE_VERSION=v$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Metadata
run: echo "container tag will be 'latest' and '${{ env.RELEASE_VERSION }}'"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub/
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
file: dockerfile
push: true
tags: |
dao0312/zarathu-dev:latest
dao0312/zarathu_dev:${{ env.RELEASE_VERSION }}
ghcr.io/${{ github.repository_owner }}/devenv:latest
ghcr.io/${{ github.repository_owner }}/devenv:${{ env.RELEASE_VERSION }}