This repository has been archived by the owner on Oct 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
67 lines (66 loc) · 2.2 KB
/
release_docker.yml
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
59
60
61
62
63
64
65
66
67
name: Build and Release Docker Artifact
on:
push:
branches:
- main
tags:
- v[0-9].[0-9]+.[0-9]+
jobs:
push_to_registry:
name: Push Docker image to Azure and Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: azure/docker-login@v1
if: github.repository == 'wasmCloud/wash'
with:
login-server: ${{ secrets.AZURECR_PUSH_URL }}
username: ${{ secrets.AZURECR_PUSH_USER }}
password: ${{ secrets.AZURECR_PUSH_PASSWORD }}
- uses: docker/login-action@v2
if: github.repository == 'wasmCloud/wash'
with:
username: ${{ secrets.DOCKERHUB_PUSH_USER }}
password: ${{ secrets.DOCKERHUB_PUSH_PASSWORD }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
wasmcloud/wash
wasmcloud.azurecr.io/wash
tags: |
type=semver,pattern={{version}}
type=sha
flavor: |
latest=auto
labels: |
org.opencontainers.image.title=wash
org.opencontainers.image.description=WAsmcloud SHell
org.opencontainers.image.vendor=wasmCloud
org.opencontainers.image.source=https://github.com/${{ github.repository }}
- name: Build and push
id: docker_build_builder
uses: docker/build-push-action@v4
with:
file: "Dockerfile"
push: ${{ github.repository == 'wasmCloud/wash' }}
target: release-alpine
tags: |
wasmcloud/wash:alpine
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push - scratch
id: docker_build
uses: docker/build-push-action@v4
with:
file: "Dockerfile"
push: ${{ github.repository == 'wasmcloud/wash' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}