This repository has been archived by the owner on Mar 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Add staging workflow #258
Merged
Merged
Add staging workflow #258
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9e930cc
Add staging workflow
fewensa d93da6d
Test CI
fewensa e1e0b0e
CI
fewensa 6903869
Add deps
fewensa e5e615d
CI
fewensa 7a7347b
CI
fewensa d6b2dab
CI
fewensa 9bc9b1f
Updte trigger
fewensa 84d624d
Merge branch 'main' into fewensa-staging-ci
fewensa 59af7c6
Merge branch 'main' into fewensa-staging-ci
AurevoirXavier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Staging | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
env: | ||
DOCKER_REGISTRY: ghcr.io | ||
|
||
jobs: | ||
build-package: | ||
name: Build package [linux] | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ubuntu:18.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
apt update -y | ||
apt install --no-install-recommends -y \ | ||
ca-certificates curl git python3-pip \ | ||
clang make gcc g++ protobuf-compiler | ||
pip3 install --upgrade pip | ||
pip3 install cmake --upgrade | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
|
||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --locked | ||
|
||
- name: Collect shared | ||
run: | | ||
mkdir -p shared | ||
tar cjSf \ | ||
shared/darwinia2-x86_64-linux-gnu.tar.bz2 \ | ||
-C \ | ||
target/release \ | ||
darwinia | ||
- name: Upload shared | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: darwinia-artifact | ||
path: shared | ||
|
||
|
||
build-docker-image: | ||
name: Build image | ||
runs-on: ubuntu-latest | ||
needs: [build-package] | ||
steps: | ||
- name: Fetch latest code | ||
uses: actions/checkout@v3 | ||
|
||
- uses: benjlevesque/[email protected] | ||
|
||
- name: Docker login | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
registry: ${{ env.DOCKER_REGISTRY }} | ||
|
||
- name: Download shared | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: darwinia-artifact | ||
path: shared | ||
|
||
- name: Extract shared | ||
run: | | ||
mkdir -p dist | ||
tar -xvf shared/darwinia2-x86_64-linux-gnu.tar.bz2 -C dist/ | ||
|
||
- name: Publish docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
context: . | ||
file: .maintain/docker/Dockerfile | ||
tags: ${{ env.DOCKER_REGISTRY }}/${{ github.repository }}:sha-${{ env.SHA }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM debian:stable-slim | ||
|
||
COPY dist/ /usr/local/bin | ||
|
||
EXPOSE 9933 9944 | ||
|
||
ENTRYPOINT [ "/usr/local/bin/darwinia" ] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really? It looks like we build this for every commit.