Skip to content

Commit

Permalink
Upgrade actions/setup-node action and cache dependencies on CI (#22883
Browse files Browse the repository at this point in the history
)

* Upgrade setup-node action and cache dependencies on CIg

* Update ci.yml

Upgrade node version.

Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
  • Loading branch information
ddzz and Mugen87 authored Dec 9, 2021
1 parent a4e6029 commit 833395e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ jobs:
- name: Git checkout

This comment was marked as spam.

Copy link
@OHJI96

OHJI96 Jan 5, 2022

from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404, redirect

from .models import Post, Comment

def post_list(request):
posts = Post.objects.all()
context = {
'posts': posts,
}
return render(request, 'post/post_list.html', context)

def comment_create(request, post_pk):

if request.method == 'POST':
    post = get_object_or_404(Post, pk=post_pk)
    content = request.POST.get('content')

    if not content:
        return HttpResponse('댓글 내용을 입력하세요', status=400)

    Comment.objects.create(
        post=post,
        author=request.user,
        content=content
    )
    return redirect('post:post_list')
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 12
node-version: 16
cache: 'npm'
- name: Install packages
run: npm ci

Expand All @@ -37,9 +38,10 @@ jobs:
- name: Git checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 12
node-version: 16
cache: 'npm'
- name: Install packages
run: |
npm ci
Expand All @@ -63,9 +65,10 @@ jobs:
- name: Git checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 12
node-version: 16
cache: 'npm'
- name: Install packages
run: |
npm ci
Expand All @@ -84,9 +87,10 @@ jobs:
- name: Git checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 12
node-version: 16
cache: 'npm'
- name: Install packages
run: npm ci

Expand Down

0 comments on commit 833395e

Please sign in to comment.