Skip to content

ci: Push headless server image #3

ci: Push headless server image

ci: Push headless server image #3

Workflow file for this run

name: Publish Docker Images
on:
push:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- 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 Web Image
run: |
docker build \
--build-arg VERSION=${{ env.VERSION }} \
--build-arg BUILD_NUM=${{ env.BUILD_NUM }} \
-t ${{ secrets.DOCKER_USERNAME }}/alpinezen-wallpaper:headless-${{ env.VERSION }} \
.
docker push ${{ secrets.DOCKER_USERNAME }}/alpinezen-wallpaper:headless-${{ env.VERSION }}