-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.28 KB
/
publish-to-server.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Build and deploy Docker image
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
build-and-push:
name: Build and Push to Docker hub
runs-on: ubuntu-latest
environment: keys
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Login to Docker hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract meta
id: meta
uses: docker/metadata-action@v5
with:
images: mewapewa/projects
tags: portfolio
- name: Build and Push
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: "ApiGithubToken=${{ secrets.API_GITHUB_TOKEN }}"
pull-from-server:
name: Pull from remote
runs-on: ubuntu-latest
needs: build-and-push
environment: keys
steps:
- name: Pull from remote
run: |
curl -X POST -H 'Auth: ${{ secrets.PULLER_KEY }}' \
'https://docker-puller.memw.es/?image=mewapewa%2Fprojects%3Aportfolio&ports=10001%3A10001'