Skip to content

Commit

Permalink
Update github action
Browse files Browse the repository at this point in the history
  • Loading branch information
poudelprakash committed May 11, 2024
1 parent 724f59d commit ec14917
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 96 deletions.
41 changes: 14 additions & 27 deletions .github/workflows/build-deploy-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@ on:
workflow_dispatch:

env:
REGISTRY: ghcr.io
WEBAPP_IMAGE_NAME: poudelprakash/bigcapital-webapp
SERVER_IMAGE_NAME: poudelprakash/bigcapital-server
WEBAPP_IMAGE_NAME: poudelprakash/webapp
SERVER_IMAGE_NAME: poudelprakash/server

jobs:
build-publish-webapp:
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
name: Build and deploy webapp container
runs-on: ubuntu-latest
environment: production
Expand All @@ -30,25 +25,21 @@ jobs:
- 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

# Login to Container registry.
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.WEBAPP_IMAGE_NAME }}
images: ${{ env.WEBAPP_IMAGE_NAME }}

# Builds and push the Docker image.
- name: Build and push Docker image
Expand All @@ -57,10 +48,10 @@ jobs:
with:
context: ./
file: ./packages/webapp/Dockerfile
platforms: ${{ matrix.platform }}
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/poudelprakash/webapp:latest, ghcr.io/poudelprakash/webapp:${{github.ref_name}}
labels: ${{ steps.meta.outputs.labels }}
tags: poudelprakash/webapp:latest, poudelprakash/webapp:${{github.ref_name}}

- name: Export digest
run: |
Expand All @@ -71,7 +62,7 @@ jobs:
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-main-${{ env.PLATFORM_PAIR }}
name: digests-webapp
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
Expand All @@ -93,19 +84,15 @@ jobs:
- 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

# Login to Container registry.
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# Builds and push the Docker image.
- name: Build and push Docker image
Expand All @@ -114,9 +101,9 @@ jobs:
with:
context: ./
file: ./packages/server/Dockerfile
platforms: ${{ matrix.platform }}
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/poudelprakash/server:latest, ghcr.io/poudelprakash/server:${{github.ref_name}}
tags: poudelprakash/server:latest, poudelprakash/server:${{github.ref_name}}
labels: ${{ steps.meta.outputs.labels }}

- name: Export digest
Expand All @@ -128,11 +115,11 @@ jobs:
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-main-${{ env.PLATFORM_PAIR }}
name: digests-server
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

# Send notification to Slack channel.
# - name: Slack Notification built and published server container successfully.
# uses: rtCamp/action-slack-notify@v2
Expand Down
69 changes: 0 additions & 69 deletions .github/workflows/e2e.yml

This file was deleted.

0 comments on commit ec14917

Please sign in to comment.