Skip to content

Commit

Permalink
chore: test dockerhub deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorfdl committed Jun 21, 2024
1 parent 044226a commit aba9c0a
Showing 1 changed file with 35 additions and 31 deletions.
66 changes: 35 additions & 31 deletions .github/workflows/build-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ on:

jobs:
build:
runs-on: ${{ matrix.config.os }}
runs-on: ubuntu-latest
strategy:
matrix:
config:
- { platform: linux-x64, os: ubuntu-latest, target: x86_64-unknown-linux-gnu }
- { platform: linux-arm64, os: ubuntu-latest, target: aarch64-unknown-linux-gnu }
- { platform: linux-x64, dist: "debian", target: x86_64-unknown-linux-gnu }
# - { platform: linux-arm64, dist: "debian", target: aarch64-unknown-linux-gnu }
# - { platform: linux-x64-alpine, target: x86_64-unknown-linux-musl }
# - { platform: linux-arm64-alpine, target: aarch64-unknown-linux-musl }
environment: PROD
env:
CARGO_SERVER_SSL_CA: ${{ secrets.SERVER_SSL_CA }}
CARGO_SERVER_SSL_CERT: ${{ secrets.SERVER_SSL_CERT }}
CARGO_SERVER_SSL_KEY: ${{ secrets.SERVER_SSL_KEY }}
FILENAME: ${{ matrix.config.platform }}
FILENAME: ${{ matrix.config.dist}}-${{ matrix.config.platform }}

steps:
# Preparation Steps
Expand Down Expand Up @@ -60,17 +62,19 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: tagoio-relay-${{ env.FILENAME }}
retention-days: 1
path: target/${{ matrix.config.target }}/release/tagoio-relay

push-to-dockerhub:
needs: build

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- { platform: linux-x64, os: ubuntu-latest, architecture: linux/amd64 }
- { platform: linux-arm64, os: ubuntu-latest, architecture: linux/arm64/v8 }
- { dist: "debian", architecture: "linux/amd64,linux/arm64/v8" }
# - { platform: linux-x64-alpine, os: ubuntu-latest, architecture: linux/amd64 }
# - { platform: linux-arm64-alpine, os: ubuntu-latest, architecture: linux/arm64/v8 }

steps:
- name: Checkout code
Expand All @@ -79,8 +83,8 @@ jobs:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: tagoio-relay-${{ matrix.platform }}
path: build
pattern: debian-*

- name: List files
run: ls -la build
Expand All @@ -92,26 +96,26 @@ jobs:
exit 1
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# linux/arm64/v8,linux/amd64
- name: Build and deploy images
run: bash dockerhub.sh ${{ matrix.architecture }} ${{ github.event.inputs.version || github.event.release.tag_name }}
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Cache Docker layers
# uses: actions/cache@v4
# with:
# path: /tmp/.buildx-cache
# key: ${{ runner.os }}-buildx-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-buildx-

# - name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

# # linux/arm64/v8,linux/amd64
# - name: Build and deploy images
# run: bash dockerhub.sh ${{ matrix.architecture }} ${{ github.event.inputs.version || github.event.release.tag_name }}

0 comments on commit aba9c0a

Please sign in to comment.