feat: github action build for DockerHub

This commit is contained in:
Jack Wills
2022-09-06 01:06:56 +00:00
parent c2910aaef3
commit eff79d3cfb
2 changed files with 23 additions and 12 deletions
+21 -10
View File
@@ -7,16 +7,8 @@ jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
# cache some rust data?
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Checkout
uses: actions/checkout@v3
# Build for linux x86_64
- name: build release linux_x86_64
@@ -72,6 +64,25 @@ jobs:
- name: compress windows_x86_64 binary
run: zip -j ./oxker_windows_x86_64.zip target/x86_64-pc-windows-gnu/release/oxker.exe
# Build images for Dockerhub
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Build for Docker Hub
run: |
docker build --platform linux/arm/v6,linux/arm64,linux/amd64 \
-t ${{ secrets.DOCKERHUB_USERNAME }}/oxker:latest \
--push \
-f containerised/Dockerfile .
- name: Release
uses: softprops/action-gh-release@v1
with: