-
Notifications
You must be signed in to change notification settings - Fork 70
84 lines (75 loc) · 2.43 KB
/
docker-release.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: DockerHub Release
on:
workflow_call:
inputs:
version:
description: 'OpenVSCode Server version'
type: string
required: true
stable:
description: 'Stable or insiders release'
type: boolean
required: true
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
SLACK_WEBHOOK:
required: true
jobs:
docker-release:
runs-on: ubuntu-latest
name: Build and publish Docker image
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Set Version and Quality
run: |
set -e
version=${{ inputs.version }}
quality_name=$([ ${{ inputs.stable }} = "false" ] && echo "-insiders" || echo "")
echo "RELEASE_TAG=openvscode-server${quality_name}-v${version}" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
gitpod/openvscode-server
tags: |
type=raw,value=${{ inputs.version }},enable=${{ inputs.stable == true }}
type=raw,value=latest,enable=${{ inputs.stable == true }}
type=raw,value=insiders,enable=${{ inputs.stable == false }}
type=raw,value=nightly,enable=${{ inputs.stable == false }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
context: .
platforms: |
linux/amd64
linux/arm64
linux/arm/v7
build-args: |
RELEASE_TAG=${{ env.RELEASE_TAG }}
tags: ${{ steps.meta.outputs.tags }}
- name: Get previous job's status
id: lastrun
uses: filiptronicek/get-last-job-status@main
- name: Slack Notification
if: ${{ (success() && steps.lastrun.outputs.status == 'failed') || failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: ${{ job.status }}