Skip to content

Commit 606b72b

Browse files
build docker image
1 parent 09cd201 commit 606b72b

File tree

3 files changed

+51
-71
lines changed

3 files changed

+51
-71
lines changed

.github/workflows/main.yml

+47-69
Original file line numberDiff line numberDiff line change
@@ -31,99 +31,77 @@ jobs:
3131
name: build
3232
path: build
3333

34-
deploy-test:
34+
build-push-docker:
3535
needs: build
3636
if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
3737
runs-on: ubuntu-latest
38-
environment:
39-
name: techradar-test-aoe
40-
url: http://techradar-test-aoe.s3-website.eu-central-1.amazonaws.com/techradar/
41-
permissions:
42-
id-token: write
43-
contents: read
4438
steps:
45-
- name: Configure AWS Credentials
46-
uses: aws-actions/configure-aws-credentials@master
39+
- name: Login to GitHub Container Registry
40+
uses: docker/login-action@v3
4741
with:
48-
aws-region: eu-central-1
49-
role-to-assume: arn:aws:iam::511165248623:role/github_techradar
50-
role-session-name: GitHubActions
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
- name: Set up QEMU
46+
uses: docker/setup-qemu-action@v3
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@v3
5149
- name: Download Artifact
5250
uses: actions/download-artifact@v4
5351
with:
5452
name: build
5553
path: build
56-
- run: 'aws s3 sync --delete build/ s3://techradar-test-aoe/techradar/'
57-
58-
deploy:
59-
needs: build
60-
if: github.ref == 'refs/heads/main'
61-
runs-on: ubuntu-latest
62-
environment:
63-
name: techradar
64-
url: https://www.aoe.com/techradar/
65-
permissions:
66-
id-token: write
67-
contents: read
68-
steps:
69-
- name: Configure AWS Credentials
70-
uses: aws-actions/configure-aws-credentials@master
71-
with:
72-
aws-region: eu-central-1
73-
role-to-assume: arn:aws:iam::511165248623:role/github_techradar
74-
role-session-name: GitHubActions
75-
- name: Download Artifact
76-
uses: actions/download-artifact@v4
54+
- name: Build and push
55+
uses: docker/build-push-action@v6
7756
with:
78-
name: build
79-
path: build
80-
- run: 'aws s3 sync --delete build/ s3://techradar-prod-aoe/techradar/'
57+
context: .
58+
push: true
59+
tags: ghcr.io/aoepeople/techradar:latest
8160

82-
# deploy:
83-
# runs-on: ubuntu-20.04
84-
# if: github.ref == 'refs/heads/main'
61+
# deploy-test:
8562
# needs: build
63+
# if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
64+
# runs-on: ubuntu-latest
8665
# environment:
87-
# name: techradar
88-
# url: https://www.aoe.com/techradar/index.html
66+
# name: techradar-test-aoe
67+
# url: http://techradar-test-aoe.s3-website.eu-central-1.amazonaws.com/techradar/
68+
# permissions:
69+
# id-token: write
70+
# contents: read
8971
# steps:
72+
# - name: Configure AWS Credentials
73+
# uses: aws-actions/configure-aws-credentials@master
74+
# with:
75+
# aws-region: eu-central-1
76+
# role-to-assume: arn:aws:iam::511165248623:role/github_techradar
77+
# role-session-name: GitHubActions
9078
# - name: Download Artifact
91-
# uses: actions/download-artifact@v3
79+
# uses: actions/download-artifact@v4
9280
# with:
9381
# name: build
9482
# path: build
95-
# - uses: jakejarvis/s3-sync-action@master
96-
# with:
97-
# args: --acl public-read
98-
# env:
99-
# AWS_S3_BUCKET: "techradar.aoe.com"
100-
# AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
101-
# AWS_SECRET_ACCESS_KEY: ${{ secrets.ACCESS_SECRET }}
102-
# AWS_REGION: "eu-central-1"
103-
# SOURCE_DIR: "build"
104-
# DEST_DIR: "techradar"
83+
# - run: 'aws s3 sync --delete build/ s3://techradar-test-aoe/techradar/'
10584
#
106-
# deploy-dev:
107-
# runs-on: ubuntu-20.04
108-
# if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
85+
# deploy:
10986
# needs: build
87+
# if: github.ref == 'refs/heads/main'
88+
# runs-on: ubuntu-latest
11089
# environment:
111-
# name: techradar-next
112-
# url: http://techradar-next.aoe.com.s3.eu-central-1.amazonaws.com/techradar/index.html
90+
# name: techradar
91+
# url: https://www.aoe.com/techradar/
92+
# permissions:
93+
# id-token: write
94+
# contents: read
11395
# steps:
114-
# - run: echo "WARNING! THIS DEPLOYS A STAGING ENV, RERUN THIS JOB TO GET YOUR CHANGES DEPLOYED TO STAGING"
96+
# - name: Configure AWS Credentials
97+
# uses: aws-actions/configure-aws-credentials@master
98+
# with:
99+
# aws-region: eu-central-1
100+
# role-to-assume: arn:aws:iam::511165248623:role/github_techradar
101+
# role-session-name: GitHubActions
115102
# - name: Download Artifact
116-
# uses: actions/download-artifact@v3
103+
# uses: actions/download-artifact@v4
117104
# with:
118105
# name: build
119106
# path: build
120-
# - uses: jakejarvis/s3-sync-action@master
121-
# with:
122-
# args: --acl public-read
123-
# env:
124-
# AWS_S3_BUCKET: "techradar-next.aoe.com"
125-
# AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
126-
# AWS_SECRET_ACCESS_KEY: ${{ secrets.ACCESS_SECRET }}
127-
# AWS_REGION: "eu-central-1"
128-
# SOURCE_DIR: "build"
129-
# DEST_DIR: "techradar"
107+
# - run: 'aws s3 sync --delete build/ s3://techradar-prod-aoe/techradar/'

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM nginx
2+
COPY build /usr/share/nginx/html

config.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"basePath": "/techradar",
3-
"baseUrl": "https://www.aoe.com/techradar",
2+
"basePath": "/",
3+
"baseUrl": "https://techradar.aoe.com",
44
"editUrl": "https://github.dev/AOEpeople/techradar/blob/main/radar/{release}/{id}.md",
55
"logoFile": "logo.svg",
66
"jsFile": "",

0 commit comments

Comments
 (0)