build #5
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: test | |
on: | |
workflow_dispatch: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
jobs: | |
build: | |
permissions: | |
contents: read | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Log in | |
if: github.event_name != 'pull_request' | |
run: | | |
echo "$TOKEN" | docker login ghcr.io --username "$USERNAME" --password-stdin | |
env: | |
TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
USERNAME: ${{ github.actor }} | |
- name: Build images | |
run: | | |
docker build --tag ghcr.io/$GITHUB_REPOSITORY-experimental:latest . | |
docker build -f devcontainer.Dockerfile --tag ghcr.io/$GITHUB_REPOSITORY-devcontainer:latest . | |
- name: Deploy images | |
if: github.event_name != 'pull_request' | |
run: | | |
docker push ghcr.io/$GITHUB_REPOSITORY-experimental:latest | |
docker push ghcr.io/$GITHUB_REPOSITORY-devcontainer:latest |