Skip to content

Commit

Permalink
signed container v4 (#30)
Browse files Browse the repository at this point in the history
* ci

* ci

* ci
  • Loading branch information
jmnote authored Apr 27, 2024
1 parent 864c8ab commit 0accb19
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 32 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/release.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: release
name: ci

on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- 'main'

jobs:
docker:
Expand All @@ -14,17 +19,20 @@ jobs:
id-token: write # needed for signing the images with GitHub OIDC Token
steps:
- uses: actions/checkout@v4

- uses: docker/metadata-action@v5
id: docker_meta
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=tag
tags: |
type=ref,event=tag
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v5
id: build_and_push
with:
Expand All @@ -35,7 +43,7 @@ jobs:

- uses: sigstore/cosign-installer@v3
- name: Sign the images with GitHub OIDC Token
if: ${{ github.event_name != 'pull_request' }}
if: github.event_name != 'pull_request'
env:
DIGEST: ${{ steps.build_and_push.outputs.digest }}
TAGS: ${{ steps.docker_meta.outputs.tags }}
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,3 @@ jobs:
- uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov

docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write # needed for signing the images with GitHub OIDC Token
steps:
- uses: actions/checkout@v4
- uses: docker/metadata-action@v5
id: docker_meta
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=tag
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v5
id: build_and_push
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# myip
"What's my IP" application

[![release](https://github.com/kuoss/myip/actions/workflows/release.yml/badge.svg)](hhttps://github.com/kuoss/myip/actions/workflows/release.yml)
[![ci](https://github.com/kuoss/myip/actions/workflows/ci.yml/badge.svg)](https://github.com/kuoss/myip/actions/workflows/ci.yml)
[![pull-request](https://github.com/kuoss/myip/actions/workflows/pull-request.yml/badge.svg)](https://github.com/kuoss/myip/actions/workflows/pull-request.yml)
[![Coverage Status](https://coveralls.io/repos/github/kuoss/myip/badge.svg?branch=main)](https://coveralls.io/github/kuoss/myip?branch=main)
[![GitHub license](https://img.shields.io/github/license/kuoss/myip.svg)](https://github.com/kuoss/myip/blob/main/LICENSE)
Expand Down

0 comments on commit 0accb19

Please sign in to comment.