added env cargo from #39
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
name: test build publish | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
jobs: | |
test: | |
name: Testing | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.22.x | |
- uses: actions/checkout@v3 | |
- run: go test ./... | |
build: | |
name: Build containers | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Preparing buildx | |
run: | | |
docker run --privileged --rm tonistiigi/binfmt --install arm64 | |
docker buildx create --use | |
- name: Building container-ship images and push to hub | |
run: | | |
docker buildx build --tag oxmix/container-ship:1.1 \ | |
--tag oxmix/container-ship:latest \ | |
--push --platform linux/amd64,linux/arm64 . | |
- name: Building cargo-deployer images and push to hub | |
run: | | |
docker buildx build --tag oxmix/cargo-deployer:1 \ | |
--tag oxmix/cargo-deployer:latest \ | |
--push --platform linux/amd64,linux/arm64 cargo-deployer |