-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
110 additions
and
128 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,60 @@ | ||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
build-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential linux-headers-generic | ||
make | ||
make clean | ||
make static | ||
make clean | ||
docker-develop: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build-test | ||
if: github.event_name != 'pull_request' | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: '{{defaultContext}}' | ||
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7 | ||
push: true | ||
tags: | | ||
xddxdd/route-chain:develop | ||
xddxdd/route-chain:develop-${{ github.sha }} | ||
ghcr.io/xddxdd/route-chain:develop | ||
ghcr.io/xddxdd/route-chain:develop-${{ github.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,38 @@ | ||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
docker-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: '{{defaultContext}}' | ||
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7 | ||
push: true | ||
tags: | | ||
xddxdd/route-chain:latest | ||
xddxdd/route-chain:${{ github.event.release.tag_name }} | ||
ghcr.io/xddxdd/route-chain:latest | ||
ghcr.io/xddxdd/route-chain:${{ github.event.release.tag_name }} |
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,12 @@ | ||
FROM alpine:edge AS step_0 | ||
WORKDIR /root | ||
COPY . . | ||
RUN apk add --no-cache build-base linux-headers | ||
RUN make static | ||
|
||
################################################################################ | ||
|
||
FROM scratch AS step_1 | ||
ENV PATH=/ | ||
COPY --from=step_0 /root/route-chain / | ||
ENTRYPOINT ["/route-chain"] |