UI: Use the Feed component in /communities page #6
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: Publish Docker Image | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
build-and-push-docker-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push Docker image for ARM64 | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/arm64 | |
push: true | |
file: docker/Dockerfile.arm64 | |
tags: | | |
discuit/discuit:${{ github.sha }}-arm64 | |
- name: Build and push Docker image for AMD64 | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/amd64 | |
push: true | |
file: docker/Dockerfile.amd64 | |
tags: | | |
discuit/discuit:${{ github.sha }}-amd64 | |
- name: Create and push Docker manifest | |
uses: int128/docker-manifest-create-action@v2 | |
with: | |
tags: | | |
discuit/discuit:latest | |
discuit/discuit:${{ github.sha }} | |
sources: | | |
discuit/discuit:${{ github.sha }}-arm64 | |
discuit/discuit:${{ github.sha }}-amd64 | |
- name: Authenticate and obtain Docker Hub JWT token (for cleanup) | |
id: get_token | |
run: | | |
TOKEN=$(curl -s -H "Content-Type: application/json" \ | |
-X POST -d '{"username": "${{ secrets.DOCKERHUB_USERNAME }}", "password": "${{ secrets.DOCKERHUB_TOKEN }}"}' \ | |
https://hub.docker.com/v2/users/login/ | jq -r .token) | |
echo "::add-mask::$TOKEN" # Mask the token in the logs | |
echo "TOKEN=$TOKEN" >> $GITHUB_ENV | |
env: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Clean up old images | |
env: | |
TOKEN: ${{ env.TOKEN }} | |
run: | | |
curl -s -H "Authorization: JWT $TOKEN" -X DELETE "https://hub.docker.com/v2/repositories/discuit/discuit/tags/${{ github.sha }}-arm64/" | |
curl -s -H "Authorization: JWT $TOKEN" -X DELETE "https://hub.docker.com/v2/repositories/discuit/discuit/tags/${{ github.sha }}-amd64/" |