-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (42 loc) · 1.22 KB
/
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
name: Build & Push
on:
pull_request:
branches:
- main
- rc*/*
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-*" # Push events to matching v*, i.e. v20.15.10-rc5
env:
registry: docker.io
repository: finschia/cw-gitpod
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: login to the registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ${{env.registry}}
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: extract metadata for docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{env.registry}}/${{env.repository}}
tags: |
type=semver,pattern={{version}}
- name: docker build
uses: docker/build-push-action@v5
with:
push: ${{github.event_name != 'pull_request'}}
tags: ${{steps.meta.outputs.tags}}
labels: ${{steps.meta.outputs.labels}}
platforms: linux/amd64
file: .gitpod.Dockerfile