Skip to content

Commit

Permalink
ci: upload & download artifacts between jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-hosseini-deriv committed Jan 11, 2024
1 parent 5432b70 commit 133199a
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jobs:
- run: npm run format
- run: npm run test
- run: npm run build
- run: echo $GIT_TAG_NAME > public/version.txt

- name: Remove Storybook
uses: JesseTG/[email protected]
Expand All @@ -61,6 +60,8 @@ jobs:

- uses: olegtarasov/[email protected]
id: tagName
- run: echo $GIT_TAG_NAME > public/version.txt

# For using same tag for staging and production we need to uncomment these two below lines:
# with:
# tagRegex: "production(.*)"
Expand All @@ -73,7 +74,11 @@ jobs:

- name: Cloudflare production link ✨
run: echo "New website - http://cf-pages-deriv-com.deriv.com"

- name: upload-artifact
uses: actions/upload-artifact@v4
with:
name: production
path: public
- name: Slack Notification 📣
uses: 8398a7/action-slack@v3
with:
Expand All @@ -92,9 +97,22 @@ jobs:
if: always()

build_and_publish_to_docker_k8s:
runs-on: Runner_8cores_Deriv-app
runs-on: Runner_16cores
environment: production
steps:
- name: Checkout 🛎️
uses: actions/[email protected]
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18.x'
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: production
path: public
- name: Set version env variable
run: echo "GIT_TAG_NAME=$(cat public/version.txt)" >> $GITHUB_ENV
- name: Building docker image 🐳
run: docker build -t ${{ secrets.DOCKERHUB_ORGANISATION }}/deriv-com:latest -t ${{ secrets.DOCKERHUB_ORGANISATION }}/deriv-com:$GIT_TAG_NAME .

Expand Down Expand Up @@ -140,4 +158,4 @@ jobs:
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
if: ${{ steps.build_and_push_docker_image.outcome != 'success' }}
if: failure()

0 comments on commit 133199a

Please sign in to comment.