Setting up DNS server #7
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# GitHub recommends pinning actions to a commit SHA. | |
# To get a newer version, you will need to update the SHA. | |
# You can also reference a tag or branch, but the action may change without warning. | |
name: Create and publish a Docker image | |
on: | |
push: | |
tags: | |
- release/* | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3.4.0 | |
- name: downcase REPO | |
run: echo "REPO=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} | |
- name: Set year | |
run: echo "BUILD_YEAR=$(date +%Y)" >> $GITHUB_ENV | |
- 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: Log in to Docker Hub | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4.3.0 | |
with: | |
images: | | |
whatever4711/latex | |
ghcr.io/${{ env.REPO }} | |
- name: Build and push | |
uses: docker/build-push-action@v4.0.0 | |
with: | |
context: ./latex/ | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: YEAR=${{ env.BUILD_YEAR }} |