-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (60 loc) · 2.13 KB
/
build.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Build
on:
workflow_dispatch:
push:
branches:
- main
env:
DOCKER_REGISTRY: ghcr.io
BUILD_PREFIX: "8.0"
PROJECT_NAME: chainflip-lp
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fix Docker Hub
run: docker logout
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Inspect builder
if: github.ref == 'refs/heads/main'
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Build and push
uses: docker/[email protected]
with:
context: .
file: Dockerfile
build-args: |
"BUILD_NUMBER=${{ env.BUILD_PREFIX }}.${{ github.run_number }}"
platforms: linux/amd64
push: true
tags: |
${{ env.DOCKER_REGISTRY }}/cumpsd/${{ env.PROJECT_NAME }}:latest
${{ env.DOCKER_REGISTRY }}/cumpsd/${{ env.PROJECT_NAME }}:v${{ env.BUILD_PREFIX }}.${{ github.run_number }}
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.BUILD_PREFIX }}.${{ github.run_number }}
release_name: v${{ env.BUILD_PREFIX }}.${{ github.run_number }}
draft: false
prerelease: true
body: |
${{ github.event.head_commit.message }}
Packages available at https://github.com/CumpsD/chainflip-lp/pkgs/container/chainflip-lp