Expand formatting (#74) #99
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 Images | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*" | |
workflow_dispatch: | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
fetch-depth: 0 | |
- name: Checkout LFS objects | |
run: git lfs checkout | |
- name: Determine Version and Build Number | |
id: version | |
run: | | |
echo "BUILD_NUM=${{ github.run_number }}" >> $GITHUB_ENV | |
if [ "${{ github.ref_type }}" == "tag" ]; then | |
echo "VERSION=${{ github.ref_name }}.${{ github.run_number }}" >> $GITHUB_ENV | |
else | |
echo "VERSION=latest" >> $GITHUB_ENV | |
fi | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_API_KEY }} | |
- name: Build and Push API Image | |
run: | | |
docker build \ | |
--build-arg VERSION=${{ env.VERSION }} \ | |
--build-arg BUILD_NUM=${{ env.BUILD_NUM }} \ | |
-t ${{ secrets.DOCKER_USERNAME }}/chipper:api-${{ env.VERSION }} \ | |
services/api | |
docker push ${{ secrets.DOCKER_USERNAME }}/chipper:api-${{ env.VERSION }} | |
- name: Build and Push Web Image | |
run: | | |
docker build \ | |
--build-arg VERSION=${{ env.VERSION }} \ | |
--build-arg BUILD_NUM=${{ env.BUILD_NUM }} \ | |
-t ${{ secrets.DOCKER_USERNAME }}/chipper:web-${{ env.VERSION }} \ | |
services/web | |
docker push ${{ secrets.DOCKER_USERNAME }}/chipper:web-${{ env.VERSION }} | |
- name: Build and Push CLI Tool Image | |
run: | | |
docker build \ | |
--build-arg VERSION=${{ env.VERSION }} \ | |
--build-arg BUILD_NUM=${{ env.BUILD_NUM }} \ | |
-t ${{ secrets.DOCKER_USERNAME }}/chipper:cli-${{ env.VERSION }} \ | |
tools/cli | |
docker push ${{ secrets.DOCKER_USERNAME }}/chipper:cli-${{ env.VERSION }} | |
- name: Build and Push Embed Tool Image | |
run: | | |
docker build \ | |
--build-arg VERSION=${{ env.VERSION }} \ | |
--build-arg BUILD_NUM=${{ env.BUILD_NUM }} \ | |
-t ${{ secrets.DOCKER_USERNAME }}/chipper:embed-${{ env.VERSION }} \ | |
tools/embed | |
docker push ${{ secrets.DOCKER_USERNAME }}/chipper:embed-${{ env.VERSION }} | |
- name: Build and Push Scrape Tool Image | |
run: | | |
docker build \ | |
--build-arg VERSION=${{ env.VERSION }} \ | |
--build-arg BUILD_NUM=${{ env.BUILD_NUM }} \ | |
-t ${{ secrets.DOCKER_USERNAME }}/chipper:scrape-${{ env.VERSION }} \ | |
tools/scrape | |
docker push ${{ secrets.DOCKER_USERNAME }}/chipper:scrape-${{ env.VERSION }} |