-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub action for build Docker image added
- Loading branch information
1 parent
dda4510
commit cc83661
Showing
2 changed files
with
34 additions
and
0 deletions.
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,27 @@ | ||
name: docker | ||
|
||
on: | ||
create: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout ${{ github.event.repository.name }} | ||
uses: actions/checkout@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Build and push ${{ github.ref_name }} | ||
uses: docker/build-push-action@v3 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/portctl:latest,${{ secrets.DOCKER_HUB_USERNAME }}/portctl:${{ github.ref_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,7 @@ | ||
FROM thevlang/vlang:alpine AS builder | ||
COPY . /home/portctl | ||
RUN cd /home/portctl && v -prod -skip-unused . | ||
|
||
FROM alpine:latest | ||
COPY --from=builder /home/portctl/portctl /usr/local/bin | ||
CMD ["portctl"] |