-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (44 loc) · 1.8 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- main
- release-*
workflow_dispatch: {}
jobs:
configuration:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
# The tagger step uses the same logic in the build submodule to generate package tag
# https://github.com/upbound/build/blob/4f64913157a952dbe77cd9e05457d9abe695a1d4/makelib/common.mk#L193
- name: Set tag production
run: echo "::set-output name=VERSION_TAG::$(git describe --dirty --always --tags | sed 's/-/./2' | sed 's/-/./2' )"
id: tagger
- name: Login to Docker
uses: docker/login-action@v1
# if: env.DOCKER_USR != ''
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Discover github workspace
run: cat /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/core/definition.yaml
- name: Build
uses: crossplane-contrib/xpkg-action@v0.2.0
with:
channel: stable
version: current
command: build configuration -f ${{ github.workspace }} --name package.xpkg --ignore '.github/*,.github/*/*,examples/*,defaults/*,hack/*'
- name: Push
uses: crossplane-contrib/xpkg-action@v0.2.0
with:
command: push configuration -f package.xpkg ghcr.io/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}:${{ steps.tagger.outputs.VERSION_TAG }}
- name: Push Latest
uses: crossplane-contrib/xpkg-action@v0.2.0
with:
command: push configuration -f package.xpkg ghcr.io/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}