Skip to content

fix: code highlighting and X / Twitter embeds (#41) #48

fix: code highlighting and X / Twitter embeds (#41)

fix: code highlighting and X / Twitter embeds (#41) #48

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@3d68780484996aa9d417bb9016193885cdf1f299 # v3
- name: Create a tagname
id: tagname
run: |
echo "tagname=$(git rev-parse --short HEAD)-$(date +%Y%m%d)-$(date +%H%M)" >> $GITHUB_ENV
- name: Build & Tag Images
run: |
docker build . \
--tag registry.digitalocean.com/${{ secrets.DOCR_NAME }}/org/hashnode-preview:$tagname \
--tag registry.digitalocean.com/${{ secrets.DOCR_NAME }}/org/hashnode-preview:latest
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Log in to DigitalOcean Container Registry with short-lived credentials
run: doctl registry login --expiry-seconds 1200
- name: Push image to DigitalOcean Container Registry
run: |
docker push --all-tags registry.digitalocean.com/${{ secrets.DOCR_NAME }}/org/hashnode-preview