Update build-image.yml #28
Workflow file for this run
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 Image CI | |
env: | |
REGISTRY: ghcr.io | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set time | |
run: echo "BUILD_DATE=$(date +%s)" >> $GITHUB_ENV | |
- name: Set year | |
run: echo "BUILD_YEAR=$(date +%Y)" >> $GITHUB_ENV | |
- name: downcase REPO | |
run: echo "REPO=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} | |
- name: Checkout | |
uses: actions/checkout@v3.4.0 | |
- name: Set 8.8.8.8 as dns server | |
run: | | |
sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf | |
sudo systemctl daemon-reload | |
sudo systemctl restart systemd-networkd | |
sudo systemctl restart systemd-resolved | |
- name: Build the Docker image | |
run: docker build ./latex/ --file ./latex/Dockerfile --build-arg YEAR=${{ env.BUILD_YEAR }} --tag ${{ env.REGISTRY }}/latex:${{ env.BUILD_DATE }} |