Skip to content

Commit

Permalink
chore: use docker github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Siumauricio committed May 4, 2024
1 parent 3e8e435 commit 51f7f90
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 20 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ci

on:
pull_request:
branches:
- canary
jobs:
buildx:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

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

- name: Prepare .env file
run: |
cp .env.production.example .env.production
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: false
tags: dokploy/dokploy:canary
40 changes: 20 additions & 20 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ jobs:
- name: Run Build
run: pnpm build

build-and-push-docker-on-push:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v3
# build-and-push-docker-on-push:
# if: github.event_name == 'push'
# runs-on: ubuntu-latest
# steps:
# - name: Check out the code
# uses: actions/checkout@v3

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

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

- name: Prepare .env file
run: |
cp .env.production.example .env.production
# - name: Prepare .env file
# run: |
# cp .env.production.example .env.production

- name: Build and push Docker image using custom script
run: |
chmod +x ./docker/push.sh
./docker/push.sh ${{ github.ref_name == 'canary' && 'canary' || '' }}
# - name: Build and push Docker image using custom script
# run: |
# chmod +x ./docker/push.sh
# ./docker/push.sh ${{ github.ref_name == 'canary' && 'canary' || '' }}

0 comments on commit 51f7f90

Please sign in to comment.