Skip to content

Commit 83e1d7c

Browse files
wasagaCopilot
andauthored
ci: add github actions (#40)
GitHub 1. issue types 2. build docker for PR branch 3. build and publish main to docker hub --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 27c63f6 commit 83e1d7c

4 files changed

Lines changed: 166 additions & 0 deletions

File tree

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Bug report
3+
about: Let us know about a bug!
4+
---
5+
6+
**What happened?**
7+
8+
**What did you expect to happen?**
9+
10+
**How did it happen?**
11+
12+
1. Ran `x`
13+
2. Clicked `y`
14+
3. Saw error `z`
15+
16+
**What's your environment like?**
17+
18+
- Pomerium version (retrieve with `pomerium --version`):
19+
- Server Operating System/Architecture/Cloud:
20+
21+
**What's your config.yaml?**
22+
23+
```config.yaml
24+
# Paste your configs here
25+
# Be sure to scrub any sensitive values
26+
```
27+
28+
**What did you see in the logs?**
29+
30+
```logs
31+
# Paste your logs here.
32+
# Be sure to scrub any sensitive values
33+
```
34+
35+
**Additional context**
36+
37+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest something!
4+
---
5+
6+
**Is your feature request related to a problem? Please describe.**
7+
8+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
10+
**Describe the solution you'd like**
11+
12+
**Describe alternatives you've considered**
13+
14+
**Explain any additional use-cases**
15+
16+
If there are any use-cases that would help us understand the use/need/value please share them as they can help us decide on acceptance and prioritization.
17+
18+
**Additional context**
19+
20+
Add any other context or screenshots about the feature request here.

.github/workflows/docker-main.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Docker Main
2+
permissions:
3+
contents: read
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-22.04
12+
outputs:
13+
sha-tag: ${{ steps.metadata.outputs.sha-tag }}
14+
image: ${{ steps.metadata.outputs.image }}
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
22+
23+
- name: Login to DockerHub
24+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
25+
with:
26+
username: ${{ secrets.DOCKERHUB_USER }}
27+
password: ${{ secrets.DOCKERHUB_TOKEN }}
28+
29+
- name: Prepare Image Metadata
30+
id: metadata
31+
run: |
32+
IMAGE=pomerium/mcp-app-demo
33+
SHA_TAG=git-${GITHUB_SHA::8}
34+
TAGS=${IMAGE}:main
35+
TAGS=${TAGS},${IMAGE}:${SHA_TAG}
36+
TS=$(date +%Y%m%d%H%M%S)
37+
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
38+
echo "timestamp=${TS}" >> $GITHUB_OUTPUT
39+
echo "name=pomerium-mcp-app-demo" >> $GITHUB_OUTPUT
40+
echo "image=${IMAGE}" >> $GITHUB_OUTPUT
41+
echo "sha-tag=${SHA_TAG}" >> $GITHUB_OUTPUT
42+
43+
- name: Docker Publish - Main
44+
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
45+
with:
46+
context: .
47+
file: ./Dockerfile
48+
push: true
49+
platforms: linux/amd64,linux/arm64
50+
tags: ${{ steps.metadata.outputs.tags }}
51+
labels: |
52+
org.opencontainers.image.created=${{ steps.metadata.outputs.timestamp }}
53+
org.opencontainers.image.name=${{ steps.metadata.outputs.name }}
54+
org.opencontainers.image.revision=${{ github.sha }}

.github/workflows/test.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Docker Main
2+
permissions:
3+
contents: read
4+
on:
5+
pull_request:
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-22.04
10+
outputs:
11+
sha-tag: ${{ steps.metadata.outputs.sha-tag }}
12+
image: ${{ steps.metadata.outputs.image }}
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
17+
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
23+
24+
- name: Login to DockerHub
25+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
26+
with:
27+
username: ${{ secrets.DOCKERHUB_USER }}
28+
password: ${{ secrets.DOCKERHUB_TOKEN }}
29+
30+
- name: Prepare Image Metadata
31+
id: metadata
32+
run: |
33+
IMAGE=pomerium/mcp-app-demo
34+
SHA_TAG=git-${GITHUB_SHA::8}
35+
TAGS=${IMAGE}:main
36+
TAGS=${TAGS},${IMAGE}:${SHA_TAG}
37+
TS=$(date +%Y%m%d%H%M%S)
38+
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
39+
echo "timestamp=${TS}" >> $GITHUB_OUTPUT
40+
echo "name=${IMAGE}" >> $GITHUB_OUTPUT
41+
echo "image=${IMAGE}" >> $GITHUB_OUTPUT
42+
echo "sha-tag=${SHA_TAG}" >> $GITHUB_OUTPUT
43+
44+
- name: Docker Publish - Main
45+
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
46+
with:
47+
context: .
48+
file: ./Dockerfile
49+
push: false
50+
platforms: linux/amd64
51+
tags: ${{ steps.metadata.outputs.tags }}
52+
labels: |
53+
org.opencontainers.image.created=${{ steps.metadata.outputs.timestamp }}
54+
org.opencontainers.image.name=${{ steps.metadata.outputs.name }}
55+
org.opencontainers.image.revision=${{ github.sha }}

0 commit comments

Comments
 (0)