-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (51 loc) · 1.92 KB
/
Copy pathimage-vscode-ssh-server.yml
File metadata and controls
54 lines (51 loc) · 1.92 KB
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
---
name: Build VSCode SSH Server
on: # yamllint disable-line rule:truthy
push:
branches:
- main
paths:
- .github/workflows/image-vscode-ssh-server.yml
- images/vscode-ssh-server/**
tags:
- vscode-ssh-server-*
pull_request:
branches:
- main
paths:
- .github/workflows/image-vscode-ssh-server.yml
- images/vscode-ssh-server/**
jobs:
build-container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Login to GitHub Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compute Version Tag
env:
BRANCH: ${{ github.ref_type == 'tag' && github.ref_name || github.event_name != 'pull_request' && format('{0}.{1}.{2}', github.run_id, github.run_number, github.run_attempt) || format('{0}-pr', github.event.number) }}
id: version_tag
run: echo "tag=$BRANCH" | sed -e 's/vscode-ssh-server-//' >> "$GITHUB_OUTPUT"
- name: Generate Metadata
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
id: metadata
with:
images: ghcr.io/${{ github.repository_owner }}/vscode-ssh-server
- name: Build Image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
build-args: |
VERSION=${{ steps.version_tag.outputs.tag }}
context: images/vscode-ssh-server
labels: ${{ steps.metadata.outputs.labels }}
push: ${{ github.ref_type == 'tag' }}
tags: ghcr.io/${{ github.repository_owner }}/vscode-ssh-server:${{ steps.version_tag.outputs.tag }}