Skip to content
This repository was archived by the owner on Aug 13, 2024. It is now read-only.

Commit fdea805

Browse files
authored
Merge pull request #2 from Tchoupinax/feature/add-ci
feat(ci): add build job and build Docker image job
2 parents bba870e + 276fbf7 commit fdea805

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

.github/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build portal
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest]
12+
rust-toolchain: [stable]
13+
fail-fast: false
14+
15+
runs-on: ${{ matrix.os }}
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Install Rust toolchain
22+
uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: ${{ matrix.rust-toolchain }}
25+
components: rustfmt
26+
override: true
27+
28+
- name: Install Build Essentials
29+
run: sudo apt-get install build-essential mingw-w64 gcc
30+
31+
- name: Verify versions
32+
run: rustc --version && rustup --version && cargo --version
33+
34+
- name: Cache build artifacts
35+
id: cache-cargo
36+
uses: actions/cache@v2
37+
with:
38+
path: |
39+
~/.cargo/registry
40+
~/.cargo/git
41+
target
42+
key: ${{ runner.os }}-cargo-${{ matrix.rust-toolchain }}
43+
44+
- name: Build Portal
45+
run: cargo build --release --all-features
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build docker image next
2+
3+
on:
4+
push:
5+
branches:
6+
- feature/**
7+
8+
jobs:
9+
build-portal-docker-image:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Get current date
13+
id: date
14+
run: echo "date=$(date +'%Y-%m-%d-%Hh%M')" >> $GITHUB_OUTPUT
15+
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: Login to Docker Hub
23+
uses: docker/login-action@v3
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Build and push
30+
uses: docker/build-push-action@v5
31+
with:
32+
context: "{{defaultContext}}:backend"
33+
platforms: linux/amd64,linux/arm64
34+
push: true
35+
tags: ghcr.io/qovery/portal:next,ghcr.io/qovery/portal:next-${{ steps.date.outputs.date }}

0 commit comments

Comments
 (0)