This repository has been archived by the owner on Oct 20, 2024. It is now read-only.
Refactor GitHub Actions workflows for version tagging and build #47
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: build | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
name: Build and push | |
runs-on: self-hosted | |
environment: prod | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@master | |
- | |
name: Docker login | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- | |
name: Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
tags: | | |
type=semver,pattern={{version}} | |
images: | | |
alejoide/alejoide-web | |
- | |
name: Add env files | |
run: | | |
echo "$APP_ENV_CONTENT" > ./src/.env | |
env: | |
APP_ENV_CONTENT: ${{ secrets.APP_ENV_CONTENT }} | |
- | |
name: Build and push to Docker Hub | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./src | |
tags: ${{ steps.meta.outputs.tags }} | |
push: true |