forked from viccuad/app-example
37 lines (37 loc) · 1.04 KB
/
ci.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
name: CI
on:
push:
tags:
- 'v*'
jobs:
ci:
runs-on: ubuntu-latest
permissions:
packages: write
id-token: write
steps:
- name: Login to GitHub
uses: docker/login-action@v1.9.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Retrieve tag name
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
echo TAG_NAME=$(echo $GITHUB_REF | sed -e "s|refs/tags/||") >> $GITHUB_ENV
- name: build + push
uses: docker/build-push-action@v2.7.0
with:
push: true
build-args: VERSION=${{ env.TAG_NAME }}
tags: ghcr.io/raulcabello/app-example:${{ env.TAG_NAME }}
- uses: sigstore/cosign-installer@main
with:
cosign-release: 'v1.8.0'
- name: Sign + push signature
run: |
cosign version
cosign sign ghcr.io/raulcabello/app-example:${{ env.TAG_NAME }}
env:
COSIGN_EXPERIMENTAL: 1