Skip to content

Commit

Permalink
Move to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
xddxdd committed Sep 9, 2023
1 parent 6719409 commit 8922b56
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 128 deletions.
27 changes: 0 additions & 27 deletions .circleci/config.yml

This file was deleted.

101 changes: 0 additions & 101 deletions .drone.jsonnet

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/develop.yaml
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 }}
38 changes: 38 additions & 0 deletions .github/workflows/release.yaml
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 }}
12 changes: 12 additions & 0 deletions Dockerfile
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"]

0 comments on commit 8922b56

Please sign in to comment.