Skip to content

Commit c90a32b

Browse files
author
karmaking
committed
add github action
1 parent 4a4df02 commit c90a32b

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
version: 2
3+
updates:
4+
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "weekly"
9+
10+
- package-ecosystem: "npm"
11+
directory: "/"
12+
schedule:
13+
interval: "daily"
14+
allow:
15+
- dependency-type: "direct"
16+
ignore:
17+
- dependency-type: "indirect"
18+
commit-message:
19+
prefix: "chore"
20+
security-updates-only: true
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: build and publish container
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
DOCKER_HUB_ORGANIZATION: ${{ vars.DOCKER_HUB_ORGANIZATION }}
10+
DOCKER_HUB_REPOSITORY: ogcr-app
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
17+
- uses: actions/checkout@v4
18+
- name: Build the Docker image with latest tag
19+
run: |
20+
echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin docker.io
21+
docker build . --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:main --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:latest
22+
docker push docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }} --all-tags
23+
echo docker ogcr-app with latest tag done
24+
25+
- uses: sigstore/cosign-installer@main
26+
- name: Write signing key to disk (only needed for `cosign sign --key`)
27+
run: echo "${{ secrets.COSIGN_PRIVATE_KEY }}" > cosign.key
28+
- name: Sign container image with annotations from our environment
29+
env:
30+
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
31+
run: |
32+
cosign sign -y --key cosign.key \
33+
-a "repo=${{ github.repository }}" \
34+
-a "workflow=${{ github.workflow }}" \
35+
-a "ref=${{ github.sha }}" \
36+
docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:main
37+
38+
39+
40+

0 commit comments

Comments
 (0)