try update tag #16
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: π’ Docker | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
docker: | |
name: π’ Docker | |
runs-on: ubuntu-latest | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- name: β Setup node | |
uses: actions/setup-node@v4 | |
- name: π₯ Install deps | |
run: npm install --frozen-lockfile | |
- name: π¨ Build image | |
run: ./scripts/build | |
- name: π₯ Smoke test | |
run: ./scripts/smoke-test | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: π’ Push image | |
run: ./scripts/push | |
- id: sha | |
name: Setup Environment | |
shell: bash | |
run: | | |
if [ "${{github.event_name}}" = "pull_request" ]; | |
then | |
long_sha=${{ github.event.pull_request.head.sha }} | |
else | |
long_sha=${GITHUB_SHA} | |
fi | |
echo "GIT_SHA=${long_sha:0:7}" >> $GITHUB_OUTPUT | |
echo $GIT_SHA | |
- name: Check sha | |
run: echo ${{ steps.sha.outputs.GIT_SHA }} | |
- name: Deploy the app | |
uses: digitalocean/app_action/deploy@v2 | |
env: | |
IMAGE_TAG_SEROVIZ: ${{ steps.sha.outputs.GIT_SHA }} | |
with: | |
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
app_name: seroviz |