-
Notifications
You must be signed in to change notification settings - Fork 5
34 lines (32 loc) · 982 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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