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: deploy:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@master - name: Checkout
uses: actions/checkout@v3
# cache some rust data?
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# Build for linux x86_64 # Build for linux x86_64
- name: build release linux_x86_64 - name: build release linux_x86_64
@@ -72,6 +64,25 @@ jobs:
- name: compress windows_x86_64 binary - name: compress windows_x86_64 binary
run: zip -j ./oxker_windows_x86_64.zip target/x86_64-pc-windows-gnu/release/oxker.exe 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 - name: Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
+1 -1
View File
@@ -22,7 +22,7 @@ WORKDIR /usr/src
RUN cargo new oxker RUN cargo new oxker
# We want dependencies cached, so copy those first # We want dependencies cached, so copy those first
COPY Cargo.toml Cargo.lock /usr/src/oxker/ COPY Cargo.* /usr/src/oxker/
# Set the working directory # Set the working directory
WORKDIR /usr/src/oxker WORKDIR /usr/src/oxker